Documentation ¶
Overview ¶
Package world and its subpackages contain everything a typical simulated world requires.
Index ¶
- Constants
- func IsConsideredCyberspaceByDefault(levelID int) bool
- func IsSavegame(provider resource.Provider) bool
- func ResourceViewStrategy() resource.ViewStrategy
- type Manifest
- func (manifest Manifest) Entry(at int) (*ManifestEntry, error)
- func (manifest Manifest) EntryCount() int
- func (manifest Manifest) Filter(lang resource.Language, id resource.ID) resource.List
- func (manifest *Manifest) InsertEntry(at int, entries ...*ManifestEntry) error
- func (manifest *Manifest) LocalizedResources(lang resource.Language) resource.Selector
- func (manifest *Manifest) MoveEntry(to, from int) error
- func (manifest *Manifest) ObjectProperties() object.PropertiesTable
- func (manifest *Manifest) RemoveEntry(at int) error
- func (manifest *Manifest) ReplaceEntry(at int, entry *ManifestEntry) error
- func (manifest *Manifest) TextureProperties() texture.PropertiesList
- type ManifestEntry
Constants ¶
const ( // StartingLevel identifies the level a new game is started in by default. StartingLevel = 1 // StartingTileX identifies the default X position of the protagonist. StartingTileX = 30 // StartingTileY identifies the default Y position of the protagonist. StartingTileY = 22 // MaxWorldTextures is the limit of how many textures the engine supports. // Note that this value is equal to that of the resource limits in package ids. It is actually based on them. MaxWorldTextures = 293 )
const (
// TexturePropertiesFilename contains the lowercase name of the file containing texture properties.
TexturePropertiesFilename = "textprop.dat"
)
Variables ¶
This section is empty.
Functions ¶
func IsConsideredCyberspaceByDefault ¶ added in v0.3.0
IsConsideredCyberspaceByDefault returns true for those level identifier that are hardcoded to be cyberspace levels. For the vanilla engine, this is true for level 10 and any above 13.
func IsSavegame ¶ added in v0.3.0
IsSavegame returns true for resources that most likely identify a savegame. A savegame is one that has a state resource (0x0FA1) and hacker's health is more than zero.
func ResourceViewStrategy ¶
func ResourceViewStrategy() resource.ViewStrategy
ResourceViewStrategy returns a strategy that is typical for the game.
Types ¶
type Manifest ¶
type Manifest struct {
// contains filtered or unexported fields
}
Manifest contains all the data and information of concrete things in a world.
func NewManifest ¶
func NewManifest(modified resource.ModificationCallback) *Manifest
NewManifest returns a new instance that notifies changes to the provided callback.
func (Manifest) Entry ¶
func (manifest Manifest) Entry(at int) (*ManifestEntry, error)
Entry returns the entry at given index.
func (Manifest) EntryCount ¶
EntryCount returns the number of entries currently in the manifest.
func (*Manifest) InsertEntry ¶
func (manifest *Manifest) InsertEntry(at int, entries ...*ManifestEntry) error
InsertEntry puts the provided entries in sequence at the specified index. Any entry at the identified index, and all those after that, are moved behind the given ones.
func (*Manifest) LocalizedResources ¶
LocalizedResources produces a selector to retrieve resources for a specific language from the manifest. The returned selector has the strategy to merge the typical compound resource lists, such as the small textures, or string lookups. It is based on StandardResourceViewStrategy().
func (*Manifest) MoveEntry ¶
MoveEntry removes an entry and reinserts it at another index. Both indices are resolved before the move.
func (*Manifest) ObjectProperties ¶ added in v0.4.0
func (manifest *Manifest) ObjectProperties() object.PropertiesTable
ObjectProperties returns the table of object properties.
func (*Manifest) RemoveEntry ¶
RemoveEntry removes the entry at given index.
func (*Manifest) ReplaceEntry ¶
func (manifest *Manifest) ReplaceEntry(at int, entry *ManifestEntry) error
ReplaceEntry removes the current entry at the identified index and puts the provided one instead.
func (*Manifest) TextureProperties ¶ added in v1.1.0
func (manifest *Manifest) TextureProperties() texture.PropertiesList
TextureProperties returns the table of texture properties.
type ManifestEntry ¶
type ManifestEntry struct { ID string Resources resource.LocalizedResourcesList ObjectProperties object.PropertiesTable TextureProperties texture.PropertiesList }
ManifestEntry describes a set of localized resources under a collective identifier.
func (ManifestEntry) LocalizedResources ¶
func (entry ManifestEntry) LocalizedResources(lang resource.Language) resource.Selector
LocalizedResources produces a selector to retrieve resources for a specific language from this entry.