Добавил систему задач для юнитов, она реализована в методе update класса Creature. Подчистил код, пофиксил по мелочам баги. Остался ещё техдолг Егору и задачи из main.
This commit is contained in:
@@ -4,9 +4,7 @@ import uuid
|
||||
import random
|
||||
from dataclasses import dataclass, field
|
||||
from copy import deepcopy
|
||||
|
||||
from collections import defaultdict
|
||||
from heapq import heappush, heappop
|
||||
from functools import partial
|
||||
|
||||
import pygame
|
||||
import pygame_gui
|
||||
@@ -15,12 +13,10 @@ from classes import Rock
|
||||
|
||||
from pathfinding.core.grid import Grid
|
||||
from pathfinding.finder.a_star import AStarFinder
|
||||
|
||||
from collections import defaultdict
|
||||
from heapq import heappush, heappop
|
||||
from math import sqrt, inf
|
||||
|
||||
|
||||
def path_exists(data, path):
|
||||
current = data
|
||||
for key in path:
|
||||
@@ -371,7 +367,7 @@ def find_way(cells, start, goal):
|
||||
queue[queue_size] = [nr, nc]
|
||||
queue_size += 1
|
||||
|
||||
print(f"Путь не найден: {start} -> {goal}")
|
||||
#print(f"Путь не найден: {start} -> {goal}")
|
||||
return None
|
||||
|
||||
def can_move_diagonal(r, c, nr, nc, rocks_only, rows, cols):
|
||||
|
||||
Reference in New Issue
Block a user