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)
}
Beispiel #2
0
func (gm *GameChunk) GetTileVec(vec vector.Vector2) tile {
	x, y := vec.Values()
	return gm.GetTile(x, y)
}
Beispiel #3
0
func (gm *GameChunk) SetTileVec(vec vector.Vector2, t tile) {
	x, y := vec.Values()
	gm.SetTile(x, y, t)
}
Beispiel #4
0
func (wm *WorldMap) GetGameChunk(pos vector.Vector2) *GameChunk {
	x, y := pos.Values()
	return wm.grid[x][y]
}
Beispiel #5
0
func (wm *WorldMap) SetGameChunk(pos vector.Vector2, gm *GameChunk) {
	x, y := pos.Values()
	wm.grid[x][y] = gm
}