world

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package world and its subpackages contain everything a typical simulated world requires.

Index

Constants

View Source
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
)
View Source
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

func IsConsideredCyberspaceByDefault(levelID int) bool

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

func IsSavegame(provider resource.Provider) bool

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

func (manifest Manifest) EntryCount() int

EntryCount returns the number of entries currently in the manifest.

func (Manifest) Filter

func (manifest Manifest) Filter(lang resource.Language, id resource.ID) resource.List

Filter finds all resources in the world that match the given parameters.

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

func (manifest *Manifest) LocalizedResources(lang resource.Language) resource.Selector

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

func (manifest *Manifest) MoveEntry(to, from int) error

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

func (manifest *Manifest) RemoveEntry(at int) error

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.

Directories

Path Synopsis
Package ids contains constants for all necessary identifier used in the world.
Package ids contains constants for all necessary identifier used in the world.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL