have Game delegate to GameMap for cleaner API

This commit is contained in:
evanpelle
2025-02-01 12:05:11 -08:00
committed by Evan
parent a17ae48cd3
commit c42cc2a9b4
10 changed files with 121 additions and 83 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { GameManager } from "../../server/GameManager";
import { Cell, Game, TerrainMap, TerrainType } from "../game/Game";
import { GameMap, TileRef } from "../game/GameMap";
import { GameMapImpl, TileRef } from "../game/GameMap";
import { AStar, PathFindResultType, } from "./AStar";
import { SerialAStar } from "./SerialAStar";
@@ -10,8 +10,8 @@ export class MiniAStar implements AStar {
private aStar: SerialAStar
constructor(
private gameMap: GameMap,
private miniMap: GameMap,
private gameMap: GameMapImpl,
private miniMap: GameMapImpl,
private src: TileRef,
private dst: TileRef,
private canMove: (t: TileRef) => boolean,
+2 -2
View File
@@ -3,7 +3,7 @@ import { AStar } from "./AStar";
import { PathFindResultType } from "./AStar";
import { Cell } from "../game/Game";
import { consolex } from "../Consolex";
import { GameMap, TileRef } from "../game/GameMap";
import { GameMapImpl, TileRef } from "../game/GameMap";
export class SerialAStar implements AStar {
@@ -22,7 +22,7 @@ export class SerialAStar implements AStar {
private canMove: (t: TileRef) => boolean,
private iterations: number,
private maxTries: number,
private gameMap: GameMap
private gameMap: GameMapImpl
) {
this.fwdOpenSet = new PriorityQueue<{ tile: TileRef; fScore: number; }>(
(a, b) => a.fScore - b.fScore