|
@@ -22,30 +22,25 @@ func main() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- err = c.LoadFile(filepath.Join("content", "tiles", "0_template.json"))
|
|
|
+ err = c.LoadTiles(filepath.Join("content", "tiles"))
|
|
|
if err != nil {
|
|
|
- _, err = os.Stat(filepath.Join("content", "tiles"))
|
|
|
- if err != nil {
|
|
|
- os.MkdirAll(filepath.Join("content", "tiles"), 0775)
|
|
|
- }
|
|
|
- err = c.MakeTemplate(filepath.Join("content", "tiles", "0_template.json"))
|
|
|
- if err != nil {
|
|
|
- log.Printf("MakeTemplate: %v", err)
|
|
|
- return
|
|
|
- }
|
|
|
- err = c.LoadFile(filepath.Join("content", "tiles", "0_template.json"))
|
|
|
- if err != nil {
|
|
|
- log.Printf("LoadFile: %v", err)
|
|
|
- return
|
|
|
- }
|
|
|
+ log.Printf("LoadTiles: %v", err)
|
|
|
+ return
|
|
|
}
|
|
|
fmt.Printf("Tiles: %d\n", len(c.Tiles))
|
|
|
for idx, t := range c.Tiles {
|
|
|
switch t.Type() {
|
|
|
case BasicTile:
|
|
|
- fmt.Printf(" %3d %s\n", idx, t.Name())
|
|
|
+ fmt.Printf(" %3d %-30s (1) %s\n", idx, t.Name(), t.Symbol())
|
|
|
case AnimatedTile:
|
|
|
- fmt.Printf("A %3d %s\n", idx, t.Name())
|
|
|
+ symbols := ""
|
|
|
+ for range make([]byte, t.Len()) {
|
|
|
+ if symbols == "" || symbols != t.Symbol() {
|
|
|
+ symbols += t.Symbol()
|
|
|
+ }
|
|
|
+ t.Next()
|
|
|
+ }
|
|
|
+ fmt.Printf("A %3d %-30s (%d) %s\n", idx, t.Name(), t.Len(), symbols)
|
|
|
}
|
|
|
}
|
|
|
}
|