Ejemplo n.º 1
0
// CanSeePosition checks if 2 positions are near each others viewport
func CanSeePosition(_p1 pos.Position, _p2 pos.Position) bool {
	if _p1.Z != _p2.Z {
		return false
	}

	return _p1.IsInRange2p(_p2, CLIENT_VIEWPORT_CENTER)
}
Ejemplo n.º 2
0
func (m *Map) GetTileFromPosition(_pos pos.Position) (*Tile, bool) {
	tiles := m.tiles[_pos.Z]
	tile, found := tiles[_pos.Hash()]
	return tile, found
}