mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 08:33:09 +00:00
have Game delegate to GameMap for cleaner API
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user