diff options
Diffstat (limited to 'engine/Dynamic/Descriptors/Tile.go')
| -rw-r--r-- | engine/Dynamic/Descriptors/Tile.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/Dynamic/Descriptors/Tile.go b/engine/Dynamic/Descriptors/Tile.go new file mode 100644 index 0000000..09c8c62 --- /dev/null +++ b/engine/Dynamic/Descriptors/Tile.go @@ -0,0 +1,24 @@ +package descriptors + +import rl "github.com/gen2brain/raylib-go/raylib" + +// Represents a type of a tile that can be used in the world +type TileDescriptor struct { + Id uint64 `json:"id"` + Position rl.Vector2 `json:"position"` + TextureId int `json:"textureid"` + OveralyTextureId int `json:"overalytextureid"` +} + +func (base *TileDescriptor) IsValid() error { + return nil +} + +// Maps the tiles by IDs +func MapTileDescriptors(data []*TileDescriptor) map[uint64]*TileDescriptor { + var outp = make(map[uint64]*TileDescriptor) + for _, v := range data { + outp[v.Id] = v + } + return outp +} |
