model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: BSD-3-Clause Imports: 7 Imported by: 3

Documentation

Index

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

func (adapter *Adapter) ActiveArchiveID() string

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

func (adapter *Adapter) ActiveProjectID() string

ActiveProjectID returns the identifier of the current project.

func (*Adapter) AvailableLevelIDs

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

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) Message

func (adapter *Adapter) Message() string

Message returns the current global message.

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

func (adapter *Adapter) RequestActiveLevel(levelID int)

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

func (*Adapter) RequestProject

func (adapter *Adapter) RequestProject(projectID string)

RequestProject sets the project to work on.

func (*Adapter) SaveProject

func (adapter *Adapter) SaveProject()

SaveProject requests to save all pending changes.

func (*Adapter) SetMessage

func (adapter *Adapter) SetMessage(message string)

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

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

OnBitmapChanged registers a callback for updates.

func (*Bitmaps) RawBitmap

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

RawBitmap returns the raw bitmap information of the identified texture.

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) ID

func (adapter *LevelAdapter) ID() int

ID returns the ID of the level.

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

type ObjectBitmapID struct {
	ObjectID ObjectID
	Index    int
}

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

func MakeObjectID(class, subclass, objType int) ObjectID

MakeObjectID returns a combined object identifier.

func ObjectIDFromInt

func ObjectIDFromInt(value int) ObjectID

ObjectIDFromInt returns an object identifier wrapping the provided integer.

func (ObjectID) Class

func (id ObjectID) Class() int

Class returns the class value.

func (ObjectID) String

func (id ObjectID) String() string

String implements the Stringer interface.

func (ObjectID) Subclass

func (id ObjectID) Subclass() int

Subclass returns the subclass value.

func (ObjectID) ToInt

func (id ObjectID) ToInt() int

ToInt returns a single integer representation of the ID.

func (ObjectID) Type

func (id ObjectID) Type() int

Type returns the type value.

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.

func (*TextAdapter) Text

func (adapter *TextAdapter) Text() string

Text returns 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 NewTile

func NewTile() *Tile

NewTile returns a new tile instance.

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

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