diagnostic tool fixes
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package gamemap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/ecs"
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/types"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
|
||||
@ -28,7 +30,7 @@ func (l *Level) GetTileNbs (coords types.Coords) []*Tile {
|
||||
result := make([]*Tile,0)
|
||||
for i := coords.X-1; i < coords.X+1; i++ {
|
||||
for j := coords.Y-1; j < coords.Y+1; j++ {
|
||||
nbc := types.Coords{i,j}
|
||||
nbc := types.Coords{X: i,Y: j}
|
||||
if l.InBounds(nbc){
|
||||
if nbc == coords {
|
||||
continue
|
||||
@ -66,14 +68,14 @@ func (l *Level) Put (x, y int, tileFunc interface{}) {
|
||||
if tile == nil {
|
||||
appctx.Logger().Fatal().Msgf("Got non-tile type to put into level: %v", tile)
|
||||
}
|
||||
if l.InBounds(types.Coords{x, y}) {
|
||||
if l.InBounds(types.Coords{X: x, Y: y}) {
|
||||
l.Tiles[y*l.W+x] = tile
|
||||
}
|
||||
}
|
||||
|
||||
func NewLevel(branch string, depth int) *Level {
|
||||
l := &Level{
|
||||
Name: branch + string(depth),
|
||||
Name: fmt.Sprintf(branch, depth),
|
||||
Depth: depth,
|
||||
Rect: types.NewRect(0,0, mapWidth, mapHeight),
|
||||
}
|
||||
@ -84,13 +86,13 @@ func NewLevel(branch string, depth int) *Level {
|
||||
}
|
||||
|
||||
func (l *Level) SetAllInvisible() {
|
||||
for idx, _ := range l.Tiles {
|
||||
for idx := range l.Tiles {
|
||||
l.Tiles[idx].Visible = false
|
||||
}
|
||||
}
|
||||
|
||||
func (l *Level) SetAllVisible() {
|
||||
for idx, _ := range l.Tiles {
|
||||
for idx := range l.Tiles {
|
||||
l.Tiles[idx].Visible = true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user