2024-03-04 16:04:40 +01:00
|
|
|
extends MovementBehaviour
|
|
|
|
|
class_name MovementBehaviourBee
|
2024-03-06 04:00:54 +01:00
|
|
|
|
2024-03-14 19:30:18 +01:00
|
|
|
func get_available_spaces(pos: Vector4i, map: HexGrid) -> Array[Vector4i]:
|
2024-03-06 04:00:54 +01:00
|
|
|
var potential_spaces = map.get_empty_neighbours(pos)
|
|
|
|
|
|
2024-03-14 19:30:18 +01:00
|
|
|
var target_spaces: Array[Vector4i] = []
|
2024-03-06 04:00:54 +01:00
|
|
|
|
2024-03-14 19:30:18 +01:00
|
|
|
for neighbour in potential_spaces:
|
|
|
|
|
if map.can_reach(pos, neighbour):
|
2024-03-06 04:00:54 +01:00
|
|
|
target_spaces.append(neighbour)
|
|
|
|
|
|
|
|
|
|
return target_spaces
|