diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2026-01-10 17:27:55 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2026-01-10 17:27:55 +0500 |
| commit | a364d4330dfd34f953f64e90020f8b8d6f2e82c4 (patch) | |
| tree | db71d125f633832b130821f3aec07d4b714ab7bb /engine/Dynamic/Descriptors/Tile.go | |
| parent | e6ccb74f77d0d03d33c422ca7dc942422074d7dd (diff) | |
World storage system change
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 +} |
