added webrtc, pre-4.3 update to fix cyclic dependency
This commit is contained in:
parent
26fec25a6e
commit
e8cd148bc7
45 changed files with 1498 additions and 43 deletions
|
|
@ -4,7 +4,7 @@ class_name MovementBehaviourBee
|
|||
func get_available_spaces(pos: Vector4i, map: HexGrid) -> Array[Vector4i]:
|
||||
var potential_spaces = map.get_empty_neighbours(pos)
|
||||
|
||||
print(potential_spaces)
|
||||
#print(potential_spaces)
|
||||
|
||||
var target_spaces: Array[Vector4i] = []
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ func simulate_move_recursive(start: Vector4i, max_num: int, exclude: Array[Vecto
|
|||
var visited = visited_cells.duplicate()
|
||||
var possible: Array[Vector4i] = []
|
||||
|
||||
visited.append(start)
|
||||
#visited.append(start)
|
||||
|
||||
if max_num < 1:
|
||||
return [start]
|
||||
|
|
@ -20,16 +20,19 @@ func simulate_move_recursive(start: Vector4i, max_num: int, exclude: Array[Vecto
|
|||
continue
|
||||
|
||||
var same_neighbours = map.get_same_neighbours(start, neighbour)
|
||||
#for e in exclude:
|
||||
# same_neighbours.erase(e)
|
||||
for e in exclude:
|
||||
same_neighbours.erase(e)
|
||||
|
||||
if same_neighbours.size() > 0:
|
||||
visited.append(neighbour)
|
||||
#map.debug_label(neighbour,str(max_movement_reach - (max_num - 1)))
|
||||
possible.append_array(simulate_move_recursive(neighbour, max_num - 1, exclude, map, visited))
|
||||
|
||||
return possible
|
||||
|
||||
func get_available_spaces(pos: Vector4i, map: HexGrid) -> Array[Vector4i]:
|
||||
#map.clear_debug_labels()
|
||||
|
||||
var possible_places: Array[Vector4i] = []
|
||||
|
||||
possible_places = simulate_move_recursive(pos, max_movement_reach, [pos], map)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue