model

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter added in v0.4.0

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter is the central model adapter.

func NewAdapter added in v0.4.0

func NewAdapter(store model.DataStore) *Adapter

NewAdapter returns a new model adapter.

func (*Adapter) ActiveArchiveID added in v0.4.0

func (adapter *Adapter) ActiveArchiveID() string

ActiveArchiveID returns the identifier of the current archive.

func (*Adapter) ActiveLevel added in v0.4.0

func (adapter *Adapter) ActiveLevel() *LevelAdapter

ActiveLevel returns the adapter for the currently active level.

func (*Adapter) ActiveProjectID added in v0.4.0

func (adapter *Adapter) ActiveProjectID() string

ActiveProjectID returns the identifier of the current project.

func (*Adapter) AvailableLevelIDs added in v0.4.0

func (adapter *Adapter) AvailableLevelIDs() []int

AvailableLevelIDs returns the list of identifier of available levels.

func (*Adapter) BitmapsAdapter added in v0.8.0

func (adapter *Adapter) BitmapsAdapter() *BitmapsAdapter

BitmapsAdapter returns the adapter for bitmaps.

func (*Adapter) ElectronicMessageAdapter added in v0.8.0

func (adapter *Adapter) ElectronicMessageAdapter() *ElectronicMessageAdapter

ElectronicMessageAdapter returns the adapter for electronic messages.

func (*Adapter) GamePalette added in v0.4.0

func (adapter *Adapter) GamePalette() *[256]model.Color

GamePalette returns the main palette.

func (*Adapter) Message added in v0.4.0

func (adapter *Adapter) Message() string

Message returns the current global message.

func (*Adapter) ObjectsAdapter added in v0.4.0

func (adapter *Adapter) ObjectsAdapter() *ObjectsAdapter

ObjectsAdapter returns the adapter for game objects.

func (*Adapter) OnAvailableLevelsChanged added in v0.4.0

func (adapter *Adapter) OnAvailableLevelsChanged(callback func())

OnAvailableLevelsChanged registers a callback for changes of available levels.

func (*Adapter) OnGamePaletteChanged added in v0.4.0

func (adapter *Adapter) OnGamePaletteChanged(callback func())

OnGamePaletteChanged registers a callback for updates.

func (*Adapter) OnMessageChanged added in v0.4.0

func (adapter *Adapter) OnMessageChanged(callback func())

OnMessageChanged registers a callback for the global message.

func (*Adapter) OnProjectChanged added in v0.10.0

func (adapter *Adapter) OnProjectChanged(callback func())

OnProjectChanged registers a callback for updates of the current project.

func (*Adapter) RequestActiveLevel added in v0.4.0

func (adapter *Adapter) RequestActiveLevel(levelID int)

RequestActiveLevel requests to set the specified level as the active one.

func (*Adapter) RequestProject added in v0.4.0

func (adapter *Adapter) RequestProject(projectID string)

RequestProject sets the project to work on.

func (*Adapter) SaveProject added in v0.11.0

func (adapter *Adapter) SaveProject()

SaveProject requests to save all pending changes.

func (*Adapter) SetMessage added in v0.4.0

func (adapter *Adapter) SetMessage(message string)

SetMessage sets the current global message.

func (*Adapter) SoundAdapter added in v0.10.0

func (adapter *Adapter) SoundAdapter() *SoundAdapter

SoundAdapter returns the adapter for sounds.

func (*Adapter) TextAdapter added in v0.10.0

func (adapter *Adapter) TextAdapter() *TextAdapter

TextAdapter returns the adapter for texts.

func (*Adapter) TextureAdapter added in v0.4.0

func (adapter *Adapter) TextureAdapter() *TextureAdapter

TextureAdapter returns the adapter for textures.

type Bitmaps added in v0.4.0

type Bitmaps struct {
	// contains filtered or unexported fields
}

Bitmaps is a container of related bitmaps.

func (*Bitmaps) OnBitmapChanged added in v0.4.0

func (bitmaps *Bitmaps) OnBitmapChanged(key int, callback func())

OnBitmapChanged registers a callback for updates.

func (*Bitmaps) RawBitmap added in v0.4.0

func (bitmaps *Bitmaps) RawBitmap(key int) (bmp *model.RawBitmap)

RawBitmap returns the raw bitmap information of the identified texture.

type BitmapsAdapter added in v0.8.0

type BitmapsAdapter struct {
	// contains filtered or unexported fields
}

BitmapsAdapter is the entry point for bitmaps.

func (*BitmapsAdapter) Bitmap added in v1.3.0

func (adapter *BitmapsAdapter) Bitmap(key model.ResourceKey) *model.RawBitmap

Bitmap returns the raw bitmap data for the given key (if loaded)

func (*BitmapsAdapter) Bitmaps added in v0.8.0

func (adapter *BitmapsAdapter) Bitmaps() *Bitmaps

Bitmaps returns the container of bitmaps.

func (*BitmapsAdapter) RequestBitmap added in v0.8.0

func (adapter *BitmapsAdapter) RequestBitmap(key model.ResourceKey)

RequestBitmap will load the bitmap data for identified key.

func (*BitmapsAdapter) RequestBitmapChange added in v0.8.0

func (adapter *BitmapsAdapter) RequestBitmapChange(key model.ResourceKey, newBitmap *model.RawBitmap)

RequestBitmapChange will update the bitmap data for identified key.

type ElectronicMessageAdapter added in v0.8.0

type ElectronicMessageAdapter struct {
	// contains filtered or unexported fields
}

ElectronicMessageAdapter is the entry point for an electronic message.

func (*ElectronicMessageAdapter) Audio added in v0.10.0

func (adapter *ElectronicMessageAdapter) Audio(language int) (data audio.SoundData)

Audio returns the audio of the message.

func (*ElectronicMessageAdapter) ColorIndex added in v0.8.0

func (adapter *ElectronicMessageAdapter) ColorIndex() int

ColorIndex returns the color index for the header text. -1 for default color.

func (*ElectronicMessageAdapter) ID added in v0.8.0

func (adapter *ElectronicMessageAdapter) ID() int

ID returns the ID of the electronic message.

func (*ElectronicMessageAdapter) IsInterrupt added in v0.8.0

func (adapter *ElectronicMessageAdapter) IsInterrupt() bool

IsInterrupt returns true if this message is an interrupt of another.

func (*ElectronicMessageAdapter) LeftDisplay added in v0.8.0

func (adapter *ElectronicMessageAdapter) LeftDisplay() int

LeftDisplay returns the display index for the left side. -1 for no display.

func (*ElectronicMessageAdapter) NextMessage added in v0.8.0

func (adapter *ElectronicMessageAdapter) NextMessage() int

NextMessage returns the identifier of an interrupting message. Or -1 if no interrupt.

func (*ElectronicMessageAdapter) OnMessageAudioChanged added in v0.10.0

func (adapter *ElectronicMessageAdapter) OnMessageAudioChanged(callback func())

OnMessageAudioChanged registers a callback for audio changes.

func (*ElectronicMessageAdapter) OnMessageDataChanged added in v0.8.0

func (adapter *ElectronicMessageAdapter) OnMessageDataChanged(callback func())

OnMessageDataChanged registers a callback for data changes.

func (*ElectronicMessageAdapter) RequestAudioChange added in v0.10.0

func (adapter *ElectronicMessageAdapter) RequestAudioChange(language model.ResourceLanguage, data audio.SoundData)

RequestAudioChange requests to change the audio of the current message.

func (*ElectronicMessageAdapter) RequestMessage added in v0.8.0

func (adapter *ElectronicMessageAdapter) RequestMessage(messageType model.ElectronicMessageType, id int)

RequestMessage requests to load the message data of specified ID.

func (*ElectronicMessageAdapter) RequestMessageChange added in v0.8.0

func (adapter *ElectronicMessageAdapter) RequestMessageChange(properties model.ElectronicMessage)

RequestMessageChange requests to change the properties of the current message.

func (*ElectronicMessageAdapter) RequestRemove added in v1.0.0

func (adapter *ElectronicMessageAdapter) RequestRemove()

RequestRemove requests to remove the current message.

func (*ElectronicMessageAdapter) RightDisplay added in v0.8.0

func (adapter *ElectronicMessageAdapter) RightDisplay() int

RightDisplay returns the display index for the right side. -1 for no display.

func (*ElectronicMessageAdapter) Sender added in v0.8.0

func (adapter *ElectronicMessageAdapter) Sender(language int) string

Sender returns the sender of the message.

func (*ElectronicMessageAdapter) Subject added in v0.8.0

func (adapter *ElectronicMessageAdapter) Subject(language int) string

Subject returns the subject of the message.

func (*ElectronicMessageAdapter) TerseText added in v0.8.0

func (adapter *ElectronicMessageAdapter) TerseText(language int) string

TerseText returns the text in short form of the message.

func (*ElectronicMessageAdapter) Title added in v0.8.0

func (adapter *ElectronicMessageAdapter) Title(language int) string

Title returns the title of the message.

func (*ElectronicMessageAdapter) VerboseText added in v0.8.0

func (adapter *ElectronicMessageAdapter) VerboseText(language int) string

VerboseText returns the text in long form of the message.

type GameObject added in v0.4.0

type GameObject struct {
	// contains filtered or unexported fields
}

GameObject describes one object available in the game.

func (*GameObject) CommonData added in v0.6.0

func (object *GameObject) CommonData() []byte

CommonData returns the common data for this object

func (*GameObject) CommonHitpoints added in v0.6.0

func (object *GameObject) CommonHitpoints() int

CommonHitpoints returns the common value for hitpoints

func (*GameObject) DisplayName added in v0.5.0

func (object *GameObject) DisplayName() string

DisplayName returns the name of the object for editor purposes

func (*GameObject) GenericData added in v0.6.0

func (object *GameObject) GenericData() []byte

GenericData returns the generic data for this object

func (*GameObject) ID added in v0.5.0

func (object *GameObject) ID() ObjectID

ID returns the identification of the object.

func (*GameObject) SpecificData added in v0.6.0

func (object *GameObject) SpecificData() []byte

SpecificData returns the specific data for this object

type GameTexture added in v0.7.0

type GameTexture struct {
	// contains filtered or unexported fields
}

GameTexture describes one texture available to the game.

func (*GameTexture) AnimationGroup added in v0.7.0

func (texture *GameTexture) AnimationGroup() int

AnimationGroup associates textures of an animation.

func (*GameTexture) AnimationIndex added in v0.7.0

func (texture *GameTexture) AnimationIndex() int

AnimationIndex places the texture within the group.

func (*GameTexture) Climbable added in v0.7.0

func (texture *GameTexture) Climbable() bool

Climbable returns whether the texture can be climbed.

func (*GameTexture) ID added in v0.7.0

func (texture *GameTexture) ID() int

ID uniquely identifies the texture in the game.

func (*GameTexture) Name added in v0.7.0

func (texture *GameTexture) Name(language model.ResourceLanguage) string

Name returns the name of the texture in given language.

func (*GameTexture) TransparencyControl added in v0.7.0

func (texture *GameTexture) TransparencyControl() int

TransparencyControl returns how the pixel data shall be interpreted.

func (*GameTexture) UseText added in v0.7.0

func (texture *GameTexture) UseText(language model.ResourceLanguage) string

UseText returns the usage text of the texture in given language.

type LevelAdapter added in v0.4.0

type LevelAdapter struct {
	// contains filtered or unexported fields
}

LevelAdapter is the entry point for a level.

func (*LevelAdapter) CeilingEffect added in v0.7.0

func (adapter *LevelAdapter) CeilingEffect() (radiation bool, level int)

CeilingEffect returns whether radiation is enabled and what its level is.

func (*LevelAdapter) FloorEffect added in v0.7.0

func (adapter *LevelAdapter) FloorEffect() (biohazard bool, gravity bool, level int)

FloorEffect returns whether biohazard is enabled, floor has gravity, and what the level is.

func (*LevelAdapter) HeightShift added in v0.7.0

func (adapter *LevelAdapter) HeightShift() int

HeightShift returns the height shift value, or -1 if not known.

func (*LevelAdapter) ID added in v0.4.0

func (adapter *LevelAdapter) ID() int

ID returns the ID of the level.

func (*LevelAdapter) IsCyberspace added in v0.4.0

func (adapter *LevelAdapter) IsCyberspace() (result bool)

IsCyberspace returns true for cyberspace levels.

func (*LevelAdapter) LevelObject added in v0.11.0

func (adapter *LevelAdapter) LevelObject(index int) *LevelObject

LevelObject returns the object for given index. nil if not known.

func (*LevelAdapter) LevelObjects added in v0.4.0

func (adapter *LevelAdapter) LevelObjects(filter func(*LevelObject) bool) []*LevelObject

LevelObjects returns a sorted set of objects that match the provided filter.

func (*LevelAdapter) LevelTextureID added in v0.4.0

func (adapter *LevelAdapter) LevelTextureID(index int) (id int)

LevelTextureID returns the texture ID for given level index.

func (*LevelAdapter) LevelTextureIDs added in v0.4.0

func (adapter *LevelAdapter) LevelTextureIDs() []int

LevelTextureIDs returns the IDs of the level textures.

func (*LevelAdapter) ObjectSurveillanceCount added in v0.7.0

func (adapter *LevelAdapter) ObjectSurveillanceCount() int

ObjectSurveillanceCount returns how many surveillance objects there are.

func (*LevelAdapter) ObjectSurveillanceInfo added in v0.7.0

func (adapter *LevelAdapter) ObjectSurveillanceInfo(index int) (source int, deathwatch int)

ObjectSurveillanceInfo returns the current source and deathwatch indices for given surveillance index.

func (*LevelAdapter) OnIDChanged added in v0.4.0

func (adapter *LevelAdapter) OnIDChanged(callback func())

OnIDChanged registers a callback for changed IDs.

func (*LevelAdapter) OnLevelObjectsChanged added in v0.4.0

func (adapter *LevelAdapter) OnLevelObjectsChanged(callback func())

OnLevelObjectsChanged registers a callback for updates on the list of level objects.

func (*LevelAdapter) OnLevelPropertiesChanged added in v0.7.0

func (adapter *LevelAdapter) OnLevelPropertiesChanged(callback func())

OnLevelPropertiesChanged registers for updates of the level properties.

func (*LevelAdapter) OnLevelSurveillanceChanged added in v0.7.0

func (adapter *LevelAdapter) OnLevelSurveillanceChanged(callback func())

OnLevelSurveillanceChanged registers for updates about the surveillance.

func (*LevelAdapter) OnLevelTextureAnimationsChanged added in v0.7.0

func (adapter *LevelAdapter) OnLevelTextureAnimationsChanged(callback func())

OnLevelTextureAnimationsChanged registers for updates of the animation groups.

func (*LevelAdapter) OnLevelTexturesChanged added in v0.4.0

func (adapter *LevelAdapter) OnLevelTexturesChanged(callback func())

OnLevelTexturesChanged registers for updates of the level textures.

func (*LevelAdapter) RequestLevelPropertiesChange added in v0.7.0

func (adapter *LevelAdapter) RequestLevelPropertiesChange(modifier func(properties *model.LevelProperties))

RequestLevelPropertiesChange requests to change the properties of the level.

func (*LevelAdapter) RequestLevelTextureAnimationGroupChange added in v0.7.0

func (adapter *LevelAdapter) RequestLevelTextureAnimationGroupChange(id int, properties model.TextureAnimation)

RequestLevelTextureAnimationGroupChange requests the change properties of a texture animation group.

func (*LevelAdapter) RequestLevelTexturesChange added in v0.4.0

func (adapter *LevelAdapter) RequestLevelTexturesChange(textureIDs []int)

RequestLevelTexturesChange requests to change the level textures list

func (*LevelAdapter) RequestNewObject added in v0.5.0

func (adapter *LevelAdapter) RequestNewObject(worldX, worldY float32, objectID ObjectID, atGrid bool)

RequestNewObject requests to add a new object at the given coordinate.

func (*LevelAdapter) RequestObjectPropertiesChange added in v0.5.0

func (adapter *LevelAdapter) RequestObjectPropertiesChange(objectIndices []int, properties *model.LevelObjectProperties)

RequestObjectPropertiesChange requests to modify identified objects.

func (*LevelAdapter) RequestObjectSurveillance added in v0.7.0

func (adapter *LevelAdapter) RequestObjectSurveillance(surveillanceIndex int, sourceObject *int, deathwatchObject *int)

RequestObjectSurveillance requests to modify the surveillance information of identified object.

func (*LevelAdapter) RequestRemoveObjects added in v0.5.0

func (adapter *LevelAdapter) RequestRemoveObjects(objectIndices []int)

RequestRemoveObjects requests to remove all identified objects.

func (*LevelAdapter) RequestTilePropertyChange added in v0.4.0

func (adapter *LevelAdapter) RequestTilePropertyChange(coordinates []TileCoordinate, properties *model.TileProperties)

RequestTilePropertyChange requests the tiles at given coordinates to set provided properties.

func (*LevelAdapter) TextureAnimationGroup added in v0.7.0

func (adapter *LevelAdapter) TextureAnimationGroup(id int) *LevelTextureAnimationGroup

TextureAnimationGroup returns the group instance for given group ID.

func (*LevelAdapter) TextureAnimationGroupCount added in v0.7.0

func (adapter *LevelAdapter) TextureAnimationGroupCount() int

TextureAnimationGroupCount returns how many groups are available.

func (*LevelAdapter) TileMap added in v0.4.0

func (adapter *LevelAdapter) TileMap() *TileMap

TileMap returns the map of tiles of the level.

type LevelObject added in v0.3.0

type LevelObject struct {
	// contains filtered or unexported fields
}

LevelObject describes one object within a level

func (*LevelObject) Center added in v0.3.0

func (obj *LevelObject) Center() (x, y float32)

Center returns the location of the object within the map

func (*LevelObject) ClassData added in v0.4.0

func (obj *LevelObject) ClassData() []byte

ClassData returns the raw data for the level object.

func (*LevelObject) ExtraData added in v0.10.2

func (obj *LevelObject) ExtraData() []byte

ExtraData returns the raw extra data for the level object.

func (*LevelObject) FineX added in v0.5.0

func (obj *LevelObject) FineX() int

FineX returns the x-coordinate (fine, within tile)

func (*LevelObject) FineY added in v0.5.0

func (obj *LevelObject) FineY() int

FineY returns the y-coordinate (fine, within tile)

func (*LevelObject) Hitpoints added in v0.5.0

func (obj *LevelObject) Hitpoints() int

Hitpoints returns the hitpoints of the object

func (*LevelObject) ID added in v0.3.0

func (obj *LevelObject) ID() ObjectID

ID returns the object ID of the object

func (*LevelObject) Index added in v0.3.0

func (obj *LevelObject) Index() int

Index returns the object's index within the level.

func (*LevelObject) RotationX added in v0.5.0

func (obj *LevelObject) RotationX() int

RotationX returns the rotation around the X-axis

func (*LevelObject) RotationY added in v0.5.0

func (obj *LevelObject) RotationY() int

RotationY returns the rotation around the Y-axis

func (*LevelObject) RotationZ added in v0.5.0

func (obj *LevelObject) RotationZ() int

RotationZ returns the rotation around the Y-axis

func (*LevelObject) TileX added in v0.5.0

func (obj *LevelObject) TileX() int

TileX returns the x-coordinate (tile)

func (*LevelObject) TileY added in v0.5.0

func (obj *LevelObject) TileY() int

TileY returns the y-coordinate (tile)

func (*LevelObject) Z added in v0.5.0

func (obj *LevelObject) Z() int

Z returns the z-coordinate (placement height) of the object

type LevelTextureAnimationGroup added in v0.7.0

type LevelTextureAnimationGroup struct {
	// contains filtered or unexported fields
}

LevelTextureAnimationGroup describes a group of textures.

func (*LevelTextureAnimationGroup) FrameCount added in v0.7.0

func (group *LevelTextureAnimationGroup) FrameCount() int

FrameCount returns the amount of frames in the animation.

func (*LevelTextureAnimationGroup) FrameTime added in v0.7.0

func (group *LevelTextureAnimationGroup) FrameTime() int

FrameTime is for one frame, in milliseconds.

func (*LevelTextureAnimationGroup) LoopType added in v0.7.0

func (group *LevelTextureAnimationGroup) LoopType() int

LoopType returns how the animation shall behave.

type ObjectBitmapID added in v0.10.3

type ObjectBitmapID struct {
	ObjectID ObjectID
	Index    int
}

ObjectBitmapID identifies a bitmap of an object

func ObjectBitmapIDFromInt added in v0.10.3

func ObjectBitmapIDFromInt(value int) (id ObjectBitmapID)

ObjectBitmapIDFromInt returns an object bitmap identifier wrapping the provided integer.

func (ObjectBitmapID) String added in v0.10.3

func (id ObjectBitmapID) String() string

func (ObjectBitmapID) ToInt added in v0.10.3

func (id ObjectBitmapID) ToInt() int

ToInt returns a single integer representation of the ID.

type ObjectID added in v0.3.0

type ObjectID int

ObjectID is the reference of a specific game object.

func MakeObjectID added in v0.3.0

func MakeObjectID(class, subclass, objType int) ObjectID

MakeObjectID returns a combined object identifier.

func ObjectIDFromInt added in v0.4.0

func ObjectIDFromInt(value int) ObjectID

ObjectIDFromInt returns an object identifier wrapping the provided integer.

func (ObjectID) Class added in v0.3.0

func (id ObjectID) Class() int

Class returns the class value.

func (ObjectID) String added in v0.3.0

func (id ObjectID) String() string

String implements the Stringer interface.

func (ObjectID) Subclass added in v0.3.0

func (id ObjectID) Subclass() int

Subclass returns the subclass value.

func (ObjectID) ToInt added in v0.4.0

func (id ObjectID) ToInt() int

ToInt returns a single integer representation of the ID.

func (ObjectID) Type added in v0.3.0

func (id ObjectID) Type() int

Type returns the type value.

type ObjectsAdapter added in v0.4.0

type ObjectsAdapter struct {
	// contains filtered or unexported fields
}

ObjectsAdapter is the adapter for all game objects

func (*ObjectsAdapter) Bitmap added in v1.3.0

func (adapter *ObjectsAdapter) Bitmap(id ObjectBitmapID) *model.RawBitmap

Bitmap returns the raw bitmap data for the given key (if loaded)

func (*ObjectsAdapter) Bitmaps added in v0.10.3

func (adapter *ObjectsAdapter) Bitmaps() *Bitmaps

Bitmaps returns the container of bitmaps.

func (*ObjectsAdapter) Icons added in v0.4.0

func (adapter *ObjectsAdapter) Icons() *Bitmaps

Icons returns a bitmap container for the objects. The key is based on the ObjectIDs.

func (*ObjectsAdapter) Object added in v0.4.0

func (adapter *ObjectsAdapter) Object(id ObjectID) *GameObject

Object returns the object with given ID.

func (*ObjectsAdapter) ObjectIDs added in v0.4.0

func (adapter *ObjectsAdapter) ObjectIDs() []ObjectID

ObjectIDs returns a set of object identifier.

func (*ObjectsAdapter) Objects added in v0.6.0

func (adapter *ObjectsAdapter) Objects() (objects []*GameObject)

Objects returns all objects

func (*ObjectsAdapter) ObjectsOfClass added in v0.5.0

func (adapter *ObjectsAdapter) ObjectsOfClass(class int) (objects []*GameObject)

ObjectsOfClass returns all objects matching the requested class.

func (*ObjectsAdapter) OnObjectsChanged added in v0.4.0

func (adapter *ObjectsAdapter) OnObjectsChanged(callback func())

OnObjectsChanged registers a callback for updates.

func (*ObjectsAdapter) RequestBitmap added in v0.10.3

func (adapter *ObjectsAdapter) RequestBitmap(id ObjectBitmapID)

RequestBitmap will load the bitmap data for identified key.

func (*ObjectsAdapter) RequestBitmapChange added in v0.10.3

func (adapter *ObjectsAdapter) RequestBitmapChange(id ObjectBitmapID, newBitmap *model.RawBitmap)

RequestBitmapChange will update the bitmap data for identified object.

func (*ObjectsAdapter) RequestIcon added in v0.4.0

func (adapter *ObjectsAdapter) RequestIcon(id ObjectID)

RequestIcon tries to load the icon for given object ID.

func (*ObjectsAdapter) RequestObjectPropertiesChange added in v0.6.0

func (adapter *ObjectsAdapter) RequestObjectPropertiesChange(objectID ObjectID, properties *model.GameObjectProperties)

RequestObjectPropertiesChange requests to modify the properties of identifed object.

type SoundAdapter added in v0.10.0

type SoundAdapter struct {
	// contains filtered or unexported fields
}

SoundAdapter is the entry point for a sound.

func (*SoundAdapter) Audio added in v0.10.0

func (adapter *SoundAdapter) Audio() (data audio.SoundData)

Audio returns the current audio.

func (*SoundAdapter) OnAudioChanged added in v0.10.0

func (adapter *SoundAdapter) OnAudioChanged(callback func())

OnAudioChanged registers a callback for sound changes.

func (*SoundAdapter) RequestAudio added in v0.10.0

func (adapter *SoundAdapter) RequestAudio(key model.ResourceKey)

RequestAudio requests to load the audio of specified key.

func (*SoundAdapter) RequestAudioChange added in v0.10.0

func (adapter *SoundAdapter) RequestAudioChange(data audio.SoundData)

RequestAudioChange requests to change the audio of the current sound.

func (*SoundAdapter) ResourceKey added in v0.10.0

func (adapter *SoundAdapter) ResourceKey() model.ResourceKey

ResourceKey returns the key of the current sound.

type TextAdapter added in v0.10.0

type TextAdapter struct {
	// contains filtered or unexported fields
}

TextAdapter is the entry point for a text.

func (*TextAdapter) OnTextChanged added in v0.10.0

func (adapter *TextAdapter) OnTextChanged(callback func())

OnTextChanged registers a callback for text changes.

func (*TextAdapter) RequestText added in v0.10.0

func (adapter *TextAdapter) RequestText(key model.ResourceKey)

RequestText requests to load the text of specified key.

func (*TextAdapter) RequestTextChange added in v0.10.0

func (adapter *TextAdapter) RequestTextChange(text string)

RequestTextChange requests to change the properties of the current text.

func (*TextAdapter) ResourceKey added in v0.10.0

func (adapter *TextAdapter) ResourceKey() model.ResourceKey

ResourceKey returns the key of the current text.

func (*TextAdapter) Text added in v0.10.0

func (adapter *TextAdapter) Text() string

Text returns the current text.

type TextureAdapter added in v0.4.0

type TextureAdapter struct {
	// contains filtered or unexported fields
}

TextureAdapter is the entry point for game textures.

func (*TextureAdapter) GameTexture added in v0.7.0

func (adapter *TextureAdapter) GameTexture(id int) (texture *GameTexture)

GameTexture returns texture information for identified texture.

func (*TextureAdapter) OnGameTexturesChanged added in v0.7.0

func (adapter *TextureAdapter) OnGameTexturesChanged(callback func())

OnGameTexturesChanged registers a callback for updates.

func (*TextureAdapter) RequestTextureBitmapChange added in v0.8.0

func (adapter *TextureAdapter) RequestTextureBitmapChange(id int, size model.TextureSize, rawBitmap *model.RawBitmap)

RequestTextureBitmapChange requests to change the bitmap of a single texture.

func (*TextureAdapter) RequestTexturePropertiesChange added in v0.7.0

func (adapter *TextureAdapter) RequestTexturePropertiesChange(id int, properties *model.TextureProperties)

RequestTexturePropertiesChange requests to change properties of a single texture.

func (*TextureAdapter) RequestWorldTextureBitmaps added in v0.4.0

func (adapter *TextureAdapter) RequestWorldTextureBitmaps(key int)

RequestWorldTextureBitmaps will load the bitmap data for given world texture.

func (*TextureAdapter) TextureBitmap added in v1.3.0

func (adapter *TextureAdapter) TextureBitmap(id int, size model.TextureSize) *model.RawBitmap

TextureBitmap returns the raw bitmap for given key - if available.

func (*TextureAdapter) WorldTextureCount added in v0.4.0

func (adapter *TextureAdapter) WorldTextureCount() int

WorldTextureCount returns the number of available textures.

func (*TextureAdapter) WorldTextures added in v0.4.0

func (adapter *TextureAdapter) WorldTextures(size model.TextureSize) *Bitmaps

WorldTextures returns the container of bitmaps for given size.

type Tile

type Tile struct {
	// contains filtered or unexported fields
}

Tile keeps properties about one map tile.

func NewTile

func NewTile() *Tile

NewTile returns a new tile instance.

func (*Tile) OnPropertiesChanged added in v0.4.0

func (tile *Tile) OnPropertiesChanged(callback func())

OnPropertiesChanged registers a callback for change updates.

func (*Tile) Properties

func (tile *Tile) Properties() *model.TileProperties

Properties returns the current tile properties.

type TileCoordinate

type TileCoordinate struct {
	// contains filtered or unexported fields
}

TileCoordinate describes a location within a tile map.

func TileCoordinateOf

func TileCoordinateOf(x, y int) TileCoordinate

TileCoordinateOf returns a TileCoordinate with the given values.

func (TileCoordinate) String

func (coord TileCoordinate) String() string

String implements the Stringer interface.

func (TileCoordinate) XY

func (coord TileCoordinate) XY() (x int, y int)

XY returns the x and y values.

type TileMap

type TileMap struct {
	// contains filtered or unexported fields
}

TileMap contains the tiles with their properties.

func NewTileMap

func NewTileMap(width, height int) *TileMap

NewTileMap returns a new tile map instance

func (*TileMap) Tile

func (tileMap *TileMap) Tile(coord TileCoordinate) *Tile

Tile returns the tile at the given coordinate

Jump to

Keyboard shortcuts

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