]> git.lizzy.rs Git - mt.git/blob - tileanim.go
Add high-level protocol (de)serialization
[mt.git] / tileanim.go
1 package mt
2
3 type AnimType uint8
4
5 const (
6         NoAnim AnimType = iota
7         VerticalFrameAnim
8         SpritesheetAnim
9         maxAnim
10 )
11
12 type TileAnim struct {
13         Type AnimType
14         //mt:assert %s.Type < maxAnim
15
16         //mt:if %s.Type == SpritesheetAnim
17         AspectRatio [2]uint8
18         //mt:end
19
20         //mt:if %s.Type == VerticalFrameAnim
21         NFrames [2]uint16
22         //mt:end
23
24         //mt:if %s.Type != NoAnim
25         Duration float32 // in seconds
26         //mt:end
27 }