|
@@ -17,6 +17,7 @@ type Tile interface {
|
|
|
Color() string
|
|
|
|
|
|
Next()
|
|
|
+ Update() []string
|
|
|
Len() int
|
|
|
|
|
|
ToMap() map[string]any
|
|
@@ -29,6 +30,7 @@ func TileFromMap(m map[string]any) Tile {
|
|
|
log.Println("TileFromMap(m map[string]any) Missing 'symbol' or 'symbols'")
|
|
|
return nil
|
|
|
}
|
|
|
+ _, has_u := m["update"]
|
|
|
if has && !has_s {
|
|
|
t := &TileBasic{
|
|
|
name: m["name"].(string),
|
|
@@ -36,7 +38,7 @@ func TileFromMap(m map[string]any) Tile {
|
|
|
color: m["color"].(string),
|
|
|
}
|
|
|
return t
|
|
|
- } else if has_s && !has {
|
|
|
+ } else if has_s && !has && has_u {
|
|
|
syms := []string{}
|
|
|
for _, s := range m["symbols"].([]any) {
|
|
|
syms = append(syms, s.(string))
|
|
@@ -45,10 +47,15 @@ func TileFromMap(m map[string]any) Tile {
|
|
|
for _, c := range m["colors"].([]any) {
|
|
|
cols = append(cols, c.(string))
|
|
|
}
|
|
|
+ ups := []string{}
|
|
|
+ for _, u := range m["update"].([]any) {
|
|
|
+ ups = append(ups, u.(string))
|
|
|
+ }
|
|
|
t := &TileAnimated{
|
|
|
name: m["name"].(string),
|
|
|
symbols: syms,
|
|
|
colors: cols,
|
|
|
+ update: ups,
|
|
|
}
|
|
|
return t
|
|
|
} else {
|