func TestSetTile(t *testing.T) { v := vector.Vector2{5, 5} x, y := v.Values() initChunk.SetTileVec(v, TILE_GRASS) unittest.CheckEqual(t, initChunk.GetTileVec(v), TILE_GRASS) initChunk.SetTile(x, y, TILE_EMPTY) unittest.CheckEqual(t, initChunk.GetTile(x, y), TILE_EMPTY) }
func (gm *GameChunk) GetTileVec(vec vector.Vector2) tile { x, y := vec.Values() return gm.GetTile(x, y) }
func (gm *GameChunk) SetTileVec(vec vector.Vector2, t tile) { x, y := vec.Values() gm.SetTile(x, y, t) }
func (wm *WorldMap) GetGameChunk(pos vector.Vector2) *GameChunk { x, y := pos.Values() return wm.grid[x][y] }
func (wm *WorldMap) SetGameChunk(pos vector.Vector2, gm *GameChunk) { x, y := pos.Values() wm.grid[x][y] = gm }