Documentation ¶
Index ¶
- type Adapter
- func (adapter *Adapter) ActiveArchiveID() string
- func (adapter *Adapter) ActiveLevel() *LevelAdapter
- func (adapter *Adapter) ActiveProjectID() string
- func (adapter *Adapter) AvailableLevelIDs() []int
- func (adapter *Adapter) BitmapsAdapter() *BitmapsAdapter
- func (adapter *Adapter) ElectronicMessageAdapter() *ElectronicMessageAdapter
- func (adapter *Adapter) GamePalette() *[256]model.Color
- func (adapter *Adapter) Message() string
- func (adapter *Adapter) ObjectsAdapter() *ObjectsAdapter
- func (adapter *Adapter) OnAvailableLevelsChanged(callback func())
- func (adapter *Adapter) OnGamePaletteChanged(callback func())
- func (adapter *Adapter) OnMessageChanged(callback func())
- func (adapter *Adapter) OnProjectChanged(callback func())
- func (adapter *Adapter) RequestActiveLevel(levelID int)
- func (adapter *Adapter) RequestProject(projectID string)
- func (adapter *Adapter) SaveProject()
- func (adapter *Adapter) SetMessage(message string)
- func (adapter *Adapter) SoundAdapter() *SoundAdapter
- func (adapter *Adapter) TextAdapter() *TextAdapter
- func (adapter *Adapter) TextureAdapter() *TextureAdapter
- type Bitmaps
- type BitmapsAdapter
- type ElectronicMessageAdapter
- func (adapter *ElectronicMessageAdapter) Audio(language int) (data audio.SoundData)
- func (adapter *ElectronicMessageAdapter) ColorIndex() int
- func (adapter *ElectronicMessageAdapter) ID() int
- func (adapter *ElectronicMessageAdapter) IsInterrupt() bool
- func (adapter *ElectronicMessageAdapter) LeftDisplay() int
- func (adapter *ElectronicMessageAdapter) NextMessage() int
- func (adapter *ElectronicMessageAdapter) OnMessageAudioChanged(callback func())
- func (adapter *ElectronicMessageAdapter) OnMessageDataChanged(callback func())
- func (adapter *ElectronicMessageAdapter) RequestAudioChange(language model.ResourceLanguage, data audio.SoundData)
- func (adapter *ElectronicMessageAdapter) RequestMessage(messageType model.ElectronicMessageType, id int)
- func (adapter *ElectronicMessageAdapter) RequestMessageChange(properties model.ElectronicMessage)
- func (adapter *ElectronicMessageAdapter) RequestRemove()
- func (adapter *ElectronicMessageAdapter) RightDisplay() int
- func (adapter *ElectronicMessageAdapter) Sender(language int) string
- func (adapter *ElectronicMessageAdapter) Subject(language int) string
- func (adapter *ElectronicMessageAdapter) TerseText(language int) string
- func (adapter *ElectronicMessageAdapter) Title(language int) string
- func (adapter *ElectronicMessageAdapter) VerboseText(language int) string
- type GameObject
- type GameTexture
- func (texture *GameTexture) AnimationGroup() int
- func (texture *GameTexture) AnimationIndex() int
- func (texture *GameTexture) Climbable() bool
- func (texture *GameTexture) ID() int
- func (texture *GameTexture) Name(language int) string
- func (texture *GameTexture) TransparencyControl() int
- func (texture *GameTexture) UseText(language int) string
- type LevelAdapter
- func (adapter *LevelAdapter) CeilingEffect() (radiation bool, level int)
- func (adapter *LevelAdapter) FloorEffect() (biohazard bool, gravity bool, level int)
- func (adapter *LevelAdapter) HeightShift() int
- func (adapter *LevelAdapter) ID() int
- func (adapter *LevelAdapter) IsCyberspace() (result bool)
- func (adapter *LevelAdapter) LevelObject(index int) *LevelObject
- func (adapter *LevelAdapter) LevelObjects(filter func(*LevelObject) bool) []*LevelObject
- func (adapter *LevelAdapter) LevelTextureID(index int) (id int)
- func (adapter *LevelAdapter) LevelTextureIDs() []int
- func (adapter *LevelAdapter) ObjectSurveillanceCount() int
- func (adapter *LevelAdapter) ObjectSurveillanceInfo(index int) (source int, deathwatch int)
- func (adapter *LevelAdapter) OnIDChanged(callback func())
- func (adapter *LevelAdapter) OnLevelObjectsChanged(callback func())
- func (adapter *LevelAdapter) OnLevelPropertiesChanged(callback func())
- func (adapter *LevelAdapter) OnLevelSurveillanceChanged(callback func())
- func (adapter *LevelAdapter) OnLevelTextureAnimationsChanged(callback func())
- func (adapter *LevelAdapter) OnLevelTexturesChanged(callback func())
- func (adapter *LevelAdapter) RequestLevelPropertiesChange(modifier func(properties *model.LevelProperties))
- func (adapter *LevelAdapter) RequestLevelTextureAnimationGroupChange(id int, properties model.TextureAnimation)
- func (adapter *LevelAdapter) RequestLevelTexturesChange(textureIDs []int)
- func (adapter *LevelAdapter) RequestNewObject(worldX, worldY float32, objectID ObjectID)
- func (adapter *LevelAdapter) RequestObjectPropertiesChange(objectIndices []int, properties *model.LevelObjectProperties)
- func (adapter *LevelAdapter) RequestObjectSurveillance(surveillanceIndex int, sourceObject *int, deathwatchObject *int)
- func (adapter *LevelAdapter) RequestRemoveObjects(objectIndices []int)
- func (adapter *LevelAdapter) RequestTilePropertyChange(coordinates []TileCoordinate, properties *model.TileProperties)
- func (adapter *LevelAdapter) TextureAnimationGroup(id int) *LevelTextureAnimationGroup
- func (adapter *LevelAdapter) TextureAnimationGroupCount() int
- func (adapter *LevelAdapter) TileMap() *TileMap
- type LevelObject
- func (obj *LevelObject) Center() (x, y float32)
- func (obj *LevelObject) ClassData() []byte
- func (obj *LevelObject) ExtraData() []byte
- func (obj *LevelObject) FineX() int
- func (obj *LevelObject) FineY() int
- func (obj *LevelObject) Hitpoints() int
- func (obj *LevelObject) ID() ObjectID
- func (obj *LevelObject) Index() int
- func (obj *LevelObject) RotationX() int
- func (obj *LevelObject) RotationY() int
- func (obj *LevelObject) RotationZ() int
- func (obj *LevelObject) TileX() int
- func (obj *LevelObject) TileY() int
- func (obj *LevelObject) Z() int
- type LevelTextureAnimationGroup
- type ObjectBitmapID
- type ObjectID
- type ObjectsAdapter
- func (adapter *ObjectsAdapter) Bitmaps() *Bitmaps
- func (adapter *ObjectsAdapter) Icons() *Bitmaps
- func (adapter *ObjectsAdapter) Object(id ObjectID) *GameObject
- func (adapter *ObjectsAdapter) ObjectIDs() []ObjectID
- func (adapter *ObjectsAdapter) Objects() (objects []*GameObject)
- func (adapter *ObjectsAdapter) ObjectsOfClass(class int) (objects []*GameObject)
- func (adapter *ObjectsAdapter) OnObjectsChanged(callback func())
- func (adapter *ObjectsAdapter) RequestBitmap(id ObjectBitmapID)
- func (adapter *ObjectsAdapter) RequestBitmapChange(id ObjectBitmapID, newBitmap *model.RawBitmap)
- func (adapter *ObjectsAdapter) RequestIcon(id ObjectID)
- func (adapter *ObjectsAdapter) RequestObjectPropertiesChange(objectID ObjectID, properties *model.GameObjectProperties)
- type SoundAdapter
- func (adapter *SoundAdapter) Audio() (data audio.SoundData)
- func (adapter *SoundAdapter) OnAudioChanged(callback func())
- func (adapter *SoundAdapter) RequestAudio(key model.ResourceKey)
- func (adapter *SoundAdapter) RequestAudioChange(data audio.SoundData)
- func (adapter *SoundAdapter) ResourceKey() model.ResourceKey
- type TextAdapter
- type TextureAdapter
- func (adapter *TextureAdapter) GameTexture(id int) *GameTexture
- func (adapter *TextureAdapter) OnGameTexturesChanged(callback func())
- func (adapter *TextureAdapter) RequestTextureBitmapChange(id int, size model.TextureSize, rawBitmap *model.RawBitmap)
- func (adapter *TextureAdapter) RequestTexturePropertiesChange(id int, properties *model.TextureProperties)
- func (adapter *TextureAdapter) RequestWorldTextureBitmaps(key int)
- func (adapter *TextureAdapter) WorldTextureCount() int
- func (adapter *TextureAdapter) WorldTextures(size model.TextureSize) *Bitmaps
- type Tile
- type TileCoordinate
- type TileMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is the central model adapter.
func NewAdapter ¶
func NewAdapter(store model.DataStore) *Adapter
NewAdapter returns a new model adapter.
func (*Adapter) ActiveArchiveID ¶
ActiveArchiveID returns the identifier of the current archive.
func (*Adapter) ActiveLevel ¶
func (adapter *Adapter) ActiveLevel() *LevelAdapter
ActiveLevel returns the adapter for the currently active level.
func (*Adapter) ActiveProjectID ¶
ActiveProjectID returns the identifier of the current project.
func (*Adapter) AvailableLevelIDs ¶
AvailableLevelIDs returns the list of identifier of available levels.
func (*Adapter) BitmapsAdapter ¶
func (adapter *Adapter) BitmapsAdapter() *BitmapsAdapter
BitmapsAdapter returns the adapter for bitmaps.
func (*Adapter) ElectronicMessageAdapter ¶
func (adapter *Adapter) ElectronicMessageAdapter() *ElectronicMessageAdapter
ElectronicMessageAdapter returns the adapter for electronic messages.
func (*Adapter) GamePalette ¶
func (adapter *Adapter) GamePalette() *[256]model.Color
GamePalette returns the main palette.
func (*Adapter) ObjectsAdapter ¶
func (adapter *Adapter) ObjectsAdapter() *ObjectsAdapter
ObjectsAdapter returns the adapter for game objects.
func (*Adapter) OnAvailableLevelsChanged ¶
func (adapter *Adapter) OnAvailableLevelsChanged(callback func())
OnAvailableLevelsChanged registers a callback for changes of available levels.
func (*Adapter) OnGamePaletteChanged ¶
func (adapter *Adapter) OnGamePaletteChanged(callback func())
OnGamePaletteChanged registers a callback for updates.
func (*Adapter) OnMessageChanged ¶
func (adapter *Adapter) OnMessageChanged(callback func())
OnMessageChanged registers a callback for the global message.
func (*Adapter) OnProjectChanged ¶
func (adapter *Adapter) OnProjectChanged(callback func())
OnProjectChanged registers a callback for updates of the current project.
func (*Adapter) RequestActiveLevel ¶
RequestActiveLevel requests to set the specified level as the active one.
func (*Adapter) RequestProject ¶
RequestProject sets the project to work on.
func (*Adapter) SaveProject ¶
func (adapter *Adapter) SaveProject()
SaveProject requests to save all pending changes.
func (*Adapter) SetMessage ¶
SetMessage sets the current global message.
func (*Adapter) SoundAdapter ¶
func (adapter *Adapter) SoundAdapter() *SoundAdapter
SoundAdapter returns the adapter for sounds.
func (*Adapter) TextAdapter ¶
func (adapter *Adapter) TextAdapter() *TextAdapter
TextAdapter returns the adapter for texts.
func (*Adapter) TextureAdapter ¶
func (adapter *Adapter) TextureAdapter() *TextureAdapter
TextureAdapter returns the adapter for textures.
type Bitmaps ¶
type Bitmaps struct {
// contains filtered or unexported fields
}
Bitmaps is a container of related bitmaps.
func (*Bitmaps) OnBitmapChanged ¶
OnBitmapChanged registers a callback for updates.
type BitmapsAdapter ¶
type BitmapsAdapter struct {
// contains filtered or unexported fields
}
BitmapsAdapter is the entry point for bitmaps.
func (*BitmapsAdapter) Bitmaps ¶
func (adapter *BitmapsAdapter) Bitmaps() *Bitmaps
Bitmaps returns the container of bitmaps.
func (*BitmapsAdapter) RequestBitmap ¶
func (adapter *BitmapsAdapter) RequestBitmap(key model.ResourceKey)
RequestBitmap will load the bitmap data for identified key.
func (*BitmapsAdapter) RequestBitmapChange ¶
func (adapter *BitmapsAdapter) RequestBitmapChange(key model.ResourceKey, newBitmap *model.RawBitmap)
RequestBitmapChange will update the bitmap data for identified key.
type ElectronicMessageAdapter ¶
type ElectronicMessageAdapter struct {
// contains filtered or unexported fields
}
ElectronicMessageAdapter is the entry point for an electronic message.
func (*ElectronicMessageAdapter) Audio ¶
func (adapter *ElectronicMessageAdapter) Audio(language int) (data audio.SoundData)
Audio returns the audio of the message.
func (*ElectronicMessageAdapter) ColorIndex ¶
func (adapter *ElectronicMessageAdapter) ColorIndex() int
ColorIndex returns the color index for the header text. -1 for default color.
func (*ElectronicMessageAdapter) ID ¶
func (adapter *ElectronicMessageAdapter) ID() int
ID returns the ID of the electronic message.
func (*ElectronicMessageAdapter) IsInterrupt ¶
func (adapter *ElectronicMessageAdapter) IsInterrupt() bool
IsInterrupt returns true if this message is an interrupt of another.
func (*ElectronicMessageAdapter) LeftDisplay ¶
func (adapter *ElectronicMessageAdapter) LeftDisplay() int
LeftDisplay returns the display index for the left side. -1 for no display.
func (*ElectronicMessageAdapter) NextMessage ¶
func (adapter *ElectronicMessageAdapter) NextMessage() int
NextMessage returns the identifier of an interrupting message. Or -1 if no interrupt.
func (*ElectronicMessageAdapter) OnMessageAudioChanged ¶
func (adapter *ElectronicMessageAdapter) OnMessageAudioChanged(callback func())
OnMessageAudioChanged registers a callback for audio changes.
func (*ElectronicMessageAdapter) OnMessageDataChanged ¶
func (adapter *ElectronicMessageAdapter) OnMessageDataChanged(callback func())
OnMessageDataChanged registers a callback for data changes.
func (*ElectronicMessageAdapter) RequestAudioChange ¶
func (adapter *ElectronicMessageAdapter) RequestAudioChange(language model.ResourceLanguage, data audio.SoundData)
RequestAudioChange requests to change the audio of the current message.
func (*ElectronicMessageAdapter) RequestMessage ¶
func (adapter *ElectronicMessageAdapter) RequestMessage(messageType model.ElectronicMessageType, id int)
RequestMessage requests to load the message data of specified ID.
func (*ElectronicMessageAdapter) RequestMessageChange ¶
func (adapter *ElectronicMessageAdapter) RequestMessageChange(properties model.ElectronicMessage)
RequestMessageChange requests to change the properties of the current message.
func (*ElectronicMessageAdapter) RequestRemove ¶
func (adapter *ElectronicMessageAdapter) RequestRemove()
RequestRemove requests to remove the current message.
func (*ElectronicMessageAdapter) RightDisplay ¶
func (adapter *ElectronicMessageAdapter) RightDisplay() int
RightDisplay returns the display index for the right side. -1 for no display.
func (*ElectronicMessageAdapter) Sender ¶
func (adapter *ElectronicMessageAdapter) Sender(language int) string
Sender returns the sender of the message.
func (*ElectronicMessageAdapter) Subject ¶
func (adapter *ElectronicMessageAdapter) Subject(language int) string
Subject returns the subject of the message.
func (*ElectronicMessageAdapter) TerseText ¶
func (adapter *ElectronicMessageAdapter) TerseText(language int) string
TerseText returns the text in short form of the message.
func (*ElectronicMessageAdapter) Title ¶
func (adapter *ElectronicMessageAdapter) Title(language int) string
Title returns the title of the message.
func (*ElectronicMessageAdapter) VerboseText ¶
func (adapter *ElectronicMessageAdapter) VerboseText(language int) string
VerboseText returns the text in long form of the message.
type GameObject ¶
type GameObject struct {
// contains filtered or unexported fields
}
GameObject describes one object available in the game.
func (*GameObject) CommonData ¶
func (object *GameObject) CommonData() []byte
CommonData returns the common data for this object
func (*GameObject) CommonHitpoints ¶
func (object *GameObject) CommonHitpoints() int
CommonHitpoints returns the common value for hitpoints
func (*GameObject) DisplayName ¶
func (object *GameObject) DisplayName() string
DisplayName returns the name of the object for editor purposes
func (*GameObject) GenericData ¶
func (object *GameObject) GenericData() []byte
GenericData returns the generic data for this object
func (*GameObject) ID ¶
func (object *GameObject) ID() ObjectID
ID returns the identification of the object.
func (*GameObject) SpecificData ¶
func (object *GameObject) SpecificData() []byte
SpecificData returns the specific data for this object
type GameTexture ¶
type GameTexture struct {
// contains filtered or unexported fields
}
GameTexture describes one texture available to the game.
func (*GameTexture) AnimationGroup ¶
func (texture *GameTexture) AnimationGroup() int
AnimationGroup associates textures of an animation.
func (*GameTexture) AnimationIndex ¶
func (texture *GameTexture) AnimationIndex() int
AnimationIndex places the texture within the group.
func (*GameTexture) Climbable ¶
func (texture *GameTexture) Climbable() bool
Climbable returns whether the texture can be climbed.
func (*GameTexture) ID ¶
func (texture *GameTexture) ID() int
ID uniquely identifies the texture in the game.
func (*GameTexture) Name ¶
func (texture *GameTexture) Name(language int) string
Name returns the name of the texture in given language.
func (*GameTexture) TransparencyControl ¶
func (texture *GameTexture) TransparencyControl() int
TransparencyControl returns how the pixel data shall be interpreted.
func (*GameTexture) UseText ¶
func (texture *GameTexture) UseText(language int) string
UseText returns the usage text of the texture in given language.
type LevelAdapter ¶
type LevelAdapter struct {
// contains filtered or unexported fields
}
LevelAdapter is the entry point for a level.
func (*LevelAdapter) CeilingEffect ¶
func (adapter *LevelAdapter) CeilingEffect() (radiation bool, level int)
CeilingEffect returns whether radiation is enabled and what its level is.
func (*LevelAdapter) FloorEffect ¶
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 ¶
func (adapter *LevelAdapter) HeightShift() int
HeightShift returns the height shift value, or -1 if not known.
func (*LevelAdapter) IsCyberspace ¶
func (adapter *LevelAdapter) IsCyberspace() (result bool)
IsCyberspace returns true for cyberspace levels.
func (*LevelAdapter) LevelObject ¶
func (adapter *LevelAdapter) LevelObject(index int) *LevelObject
LevelObject returns the object for given index. nil if not known.
func (*LevelAdapter) LevelObjects ¶
func (adapter *LevelAdapter) LevelObjects(filter func(*LevelObject) bool) []*LevelObject
LevelObjects returns a sorted set of objects that match the provided filter.
func (*LevelAdapter) LevelTextureID ¶
func (adapter *LevelAdapter) LevelTextureID(index int) (id int)
LevelTextureID returns the texture ID for given level index.
func (*LevelAdapter) LevelTextureIDs ¶
func (adapter *LevelAdapter) LevelTextureIDs() []int
LevelTextureIDs returns the IDs of the level textures.
func (*LevelAdapter) ObjectSurveillanceCount ¶
func (adapter *LevelAdapter) ObjectSurveillanceCount() int
ObjectSurveillanceCount returns how many surveillance objects there are.
func (*LevelAdapter) ObjectSurveillanceInfo ¶
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 ¶
func (adapter *LevelAdapter) OnIDChanged(callback func())
OnIDChanged registers a callback for changed IDs.
func (*LevelAdapter) OnLevelObjectsChanged ¶
func (adapter *LevelAdapter) OnLevelObjectsChanged(callback func())
OnLevelObjectsChanged registers a callback for updates on the list of level objects.
func (*LevelAdapter) OnLevelPropertiesChanged ¶
func (adapter *LevelAdapter) OnLevelPropertiesChanged(callback func())
OnLevelPropertiesChanged registers for updates of the level properties.
func (*LevelAdapter) OnLevelSurveillanceChanged ¶
func (adapter *LevelAdapter) OnLevelSurveillanceChanged(callback func())
OnLevelSurveillanceChanged registers for updates about the surveillance.
func (*LevelAdapter) OnLevelTextureAnimationsChanged ¶
func (adapter *LevelAdapter) OnLevelTextureAnimationsChanged(callback func())
OnLevelTextureAnimationsChanged registers for updates of the animation groups.
func (*LevelAdapter) OnLevelTexturesChanged ¶
func (adapter *LevelAdapter) OnLevelTexturesChanged(callback func())
OnLevelTexturesChanged registers for updates of the level textures.
func (*LevelAdapter) RequestLevelPropertiesChange ¶
func (adapter *LevelAdapter) RequestLevelPropertiesChange(modifier func(properties *model.LevelProperties))
RequestLevelPropertiesChange requests to change the properties of the level.
func (*LevelAdapter) RequestLevelTextureAnimationGroupChange ¶
func (adapter *LevelAdapter) RequestLevelTextureAnimationGroupChange(id int, properties model.TextureAnimation)
RequestLevelTextureAnimationGroupChange requests the change properties of a texture animation group.
func (*LevelAdapter) RequestLevelTexturesChange ¶
func (adapter *LevelAdapter) RequestLevelTexturesChange(textureIDs []int)
RequestLevelTexturesChange requests to change the level textures list
func (*LevelAdapter) RequestNewObject ¶
func (adapter *LevelAdapter) RequestNewObject(worldX, worldY float32, objectID ObjectID)
RequestNewObject requests to add a new object at the given coordinate.
func (*LevelAdapter) RequestObjectPropertiesChange ¶
func (adapter *LevelAdapter) RequestObjectPropertiesChange(objectIndices []int, properties *model.LevelObjectProperties)
RequestObjectPropertiesChange requests to modify identified objects.
func (*LevelAdapter) RequestObjectSurveillance ¶
func (adapter *LevelAdapter) RequestObjectSurveillance(surveillanceIndex int, sourceObject *int, deathwatchObject *int)
RequestObjectSurveillance requests to modify the surveillance information of identified object.
func (*LevelAdapter) RequestRemoveObjects ¶
func (adapter *LevelAdapter) RequestRemoveObjects(objectIndices []int)
RequestRemoveObjects requests to remove all identified objects.
func (*LevelAdapter) RequestTilePropertyChange ¶
func (adapter *LevelAdapter) RequestTilePropertyChange(coordinates []TileCoordinate, properties *model.TileProperties)
RequestTilePropertyChange requests the tiles at given coordinates to set provided properties.
func (*LevelAdapter) TextureAnimationGroup ¶
func (adapter *LevelAdapter) TextureAnimationGroup(id int) *LevelTextureAnimationGroup
TextureAnimationGroup returns the group instance for given group ID.
func (*LevelAdapter) TextureAnimationGroupCount ¶
func (adapter *LevelAdapter) TextureAnimationGroupCount() int
TextureAnimationGroupCount returns how many groups are available.
func (*LevelAdapter) TileMap ¶
func (adapter *LevelAdapter) TileMap() *TileMap
TileMap returns the map of tiles of the level.
type LevelObject ¶
type LevelObject struct {
// contains filtered or unexported fields
}
LevelObject describes one object within a level
func (*LevelObject) Center ¶
func (obj *LevelObject) Center() (x, y float32)
Center returns the location of the object within the map
func (*LevelObject) ClassData ¶
func (obj *LevelObject) ClassData() []byte
ClassData returns the raw data for the level object.
func (*LevelObject) ExtraData ¶
func (obj *LevelObject) ExtraData() []byte
ExtraData returns the raw extra data for the level object.
func (*LevelObject) FineX ¶
func (obj *LevelObject) FineX() int
FineX returns the x-coordinate (fine, within tile)
func (*LevelObject) FineY ¶
func (obj *LevelObject) FineY() int
FineY returns the y-coordinate (fine, within tile)
func (*LevelObject) Hitpoints ¶
func (obj *LevelObject) Hitpoints() int
Hitpoints returns the hitpoints of the object
func (*LevelObject) ID ¶
func (obj *LevelObject) ID() ObjectID
ID returns the object ID of the object
func (*LevelObject) Index ¶
func (obj *LevelObject) Index() int
Index returns the object's index within the level.
func (*LevelObject) RotationX ¶
func (obj *LevelObject) RotationX() int
RotationX returns the rotation around the X-axis
func (*LevelObject) RotationY ¶
func (obj *LevelObject) RotationY() int
RotationY returns the rotation around the Y-axis
func (*LevelObject) RotationZ ¶
func (obj *LevelObject) RotationZ() int
RotationZ returns the rotation around the Y-axis
func (*LevelObject) TileX ¶
func (obj *LevelObject) TileX() int
TileX returns the x-coordinate (tile)
func (*LevelObject) TileY ¶
func (obj *LevelObject) TileY() int
TileY returns the y-coordinate (tile)
func (*LevelObject) Z ¶
func (obj *LevelObject) Z() int
Z returns the z-coordinate (placement height) of the object
type LevelTextureAnimationGroup ¶
type LevelTextureAnimationGroup struct {
// contains filtered or unexported fields
}
LevelTextureAnimationGroup describes a group of textures.
func (*LevelTextureAnimationGroup) FrameCount ¶
func (group *LevelTextureAnimationGroup) FrameCount() int
FrameCount returns the amount of frames in the animation.
func (*LevelTextureAnimationGroup) FrameTime ¶
func (group *LevelTextureAnimationGroup) FrameTime() int
FrameTime is for one frame, in milliseconds.
func (*LevelTextureAnimationGroup) LoopType ¶
func (group *LevelTextureAnimationGroup) LoopType() int
LoopType returns how the animation shall behave.
type ObjectBitmapID ¶
ObjectBitmapID identifies a bitmap of an object
func ObjectBitmapIDFromInt ¶
func ObjectBitmapIDFromInt(value int) (id ObjectBitmapID)
ObjectBitmapIDFromInt returns an object bitmap identifier wrapping the provided integer.
func (ObjectBitmapID) String ¶
func (id ObjectBitmapID) String() string
func (ObjectBitmapID) ToInt ¶
func (id ObjectBitmapID) ToInt() int
ToInt returns a single integer representation of the ID.
type ObjectID ¶
type ObjectID int
ObjectID is the reference of a specific game object.
func MakeObjectID ¶
MakeObjectID returns a combined object identifier.
func ObjectIDFromInt ¶
ObjectIDFromInt returns an object identifier wrapping the provided integer.
type ObjectsAdapter ¶
type ObjectsAdapter struct {
// contains filtered or unexported fields
}
ObjectsAdapter is the adapter for all game objects
func (*ObjectsAdapter) Bitmaps ¶
func (adapter *ObjectsAdapter) Bitmaps() *Bitmaps
Bitmaps returns the container of bitmaps.
func (*ObjectsAdapter) Icons ¶
func (adapter *ObjectsAdapter) Icons() *Bitmaps
Icons returns a bitmap container for the objects. The key is based on the ObjectIDs.
func (*ObjectsAdapter) Object ¶
func (adapter *ObjectsAdapter) Object(id ObjectID) *GameObject
Object returns the object with given ID.
func (*ObjectsAdapter) ObjectIDs ¶
func (adapter *ObjectsAdapter) ObjectIDs() []ObjectID
ObjectIDs returns a set of object identifier.
func (*ObjectsAdapter) Objects ¶
func (adapter *ObjectsAdapter) Objects() (objects []*GameObject)
Objects returns all objects
func (*ObjectsAdapter) ObjectsOfClass ¶
func (adapter *ObjectsAdapter) ObjectsOfClass(class int) (objects []*GameObject)
ObjectsOfClass returns all objects matching the requested class.
func (*ObjectsAdapter) OnObjectsChanged ¶
func (adapter *ObjectsAdapter) OnObjectsChanged(callback func())
OnObjectsChanged registers a callback for updates.
func (*ObjectsAdapter) RequestBitmap ¶
func (adapter *ObjectsAdapter) RequestBitmap(id ObjectBitmapID)
RequestBitmap will load the bitmap data for identified key.
func (*ObjectsAdapter) RequestBitmapChange ¶
func (adapter *ObjectsAdapter) RequestBitmapChange(id ObjectBitmapID, newBitmap *model.RawBitmap)
RequestBitmapChange will update the bitmap data for identified object.
func (*ObjectsAdapter) RequestIcon ¶
func (adapter *ObjectsAdapter) RequestIcon(id ObjectID)
RequestIcon tries to load the icon for given object ID.
func (*ObjectsAdapter) RequestObjectPropertiesChange ¶
func (adapter *ObjectsAdapter) RequestObjectPropertiesChange(objectID ObjectID, properties *model.GameObjectProperties)
RequestObjectPropertiesChange requests to modify the properties of identifed object.
type SoundAdapter ¶
type SoundAdapter struct {
// contains filtered or unexported fields
}
SoundAdapter is the entry point for a sound.
func (*SoundAdapter) Audio ¶
func (adapter *SoundAdapter) Audio() (data audio.SoundData)
Audio returns the current audio.
func (*SoundAdapter) OnAudioChanged ¶
func (adapter *SoundAdapter) OnAudioChanged(callback func())
OnAudioChanged registers a callback for sound changes.
func (*SoundAdapter) RequestAudio ¶
func (adapter *SoundAdapter) RequestAudio(key model.ResourceKey)
RequestAudio requests to load the audio of specified key.
func (*SoundAdapter) RequestAudioChange ¶
func (adapter *SoundAdapter) RequestAudioChange(data audio.SoundData)
RequestAudioChange requests to change the audio of the current sound.
func (*SoundAdapter) ResourceKey ¶
func (adapter *SoundAdapter) ResourceKey() model.ResourceKey
ResourceKey returns the key of the current sound.
type TextAdapter ¶
type TextAdapter struct {
// contains filtered or unexported fields
}
TextAdapter is the entry point for a text.
func (*TextAdapter) OnTextChanged ¶
func (adapter *TextAdapter) OnTextChanged(callback func())
OnTextChanged registers a callback for text changes.
func (*TextAdapter) RequestText ¶
func (adapter *TextAdapter) RequestText(key model.ResourceKey)
RequestText requests to load the text of specified key.
func (*TextAdapter) RequestTextChange ¶
func (adapter *TextAdapter) RequestTextChange(text string)
RequestTextChange requests to change the properties of the current text.
func (*TextAdapter) ResourceKey ¶
func (adapter *TextAdapter) ResourceKey() model.ResourceKey
ResourceKey returns the key of the current text.
type TextureAdapter ¶
type TextureAdapter struct {
// contains filtered or unexported fields
}
TextureAdapter is the entry point for game textures.
func (*TextureAdapter) GameTexture ¶
func (adapter *TextureAdapter) GameTexture(id int) *GameTexture
GameTexture returns texture information for identified texture.
func (*TextureAdapter) OnGameTexturesChanged ¶
func (adapter *TextureAdapter) OnGameTexturesChanged(callback func())
OnGameTexturesChanged registers a callback for updates.
func (*TextureAdapter) RequestTextureBitmapChange ¶
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 ¶
func (adapter *TextureAdapter) RequestTexturePropertiesChange(id int, properties *model.TextureProperties)
RequestTexturePropertiesChange requests to change properties of a single texture.
func (*TextureAdapter) RequestWorldTextureBitmaps ¶
func (adapter *TextureAdapter) RequestWorldTextureBitmaps(key int)
RequestWorldTextureBitmaps will load the bitmap data for given world texture.
func (*TextureAdapter) WorldTextureCount ¶
func (adapter *TextureAdapter) WorldTextureCount() int
WorldTextureCount returns the number of available textures.
func (*TextureAdapter) WorldTextures ¶
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 (*Tile) OnPropertiesChanged ¶
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 ¶
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
Source Files ¶
- Adapter.go
- Bitmaps.go
- BitmapsAdapter.go
- ElectronicMessageAdapter.go
- GameObject.go
- GameTexture.go
- LevelAdapter.go
- LevelObject.go
- LevelTextureAnimationGroup.go
- ObjectBitmapID.go
- ObjectID.go
- ObjectsAdapter.go
- Observable.go
- ProjectContext.go
- SoundAdapter.go
- TextAdapter.go
- TextureAdapter.go
- Tile.go
- TileCoordinate.go
- TileMap.go
- archiveContext.go
- util.go