Documentation ¶
Overview ¶
Package world and its subpackages contain everything a typical simulated world requires.
Index ¶
- 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, entry *ManifestEntry) error
- func (manifest *Manifest) LocalizedResources(lang resource.Language) resource.Selector
- func (manifest *Manifest) MoveEntry(to, from int) error
- func (manifest *Manifest) RemoveEntry(at int) error
- func (manifest *Manifest) ReplaceEntry(at int, entry *ManifestEntry) error
- type ManifestEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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, entry *ManifestEntry) error
InsertEntry puts the provided entry at the specified index. Any entry at the identified index, and all those after that, are moved by one.
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) 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.
type ManifestEntry ¶
type ManifestEntry struct { ID string Resources resource.LocalizedResourcesList }
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.