blob: 09c8c627c718134a174e9a08e987fbf02a92ccc1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
}
|