public GameBoard(ITerrainMap terrainMap, IUnitList unitList, IShortestPath shortestPath, IAlliedEnemyMatrix alliedEnemyMatrix, IVictoryCalculator victoryCalculator, IEnemyPlan enemyPlan) { _terrainMap = terrainMap; _units = unitList; _shortestPath = shortestPath; _alliedEnemyMatrix = alliedEnemyMatrix; _endOfGame = victoryCalculator; _enemyPlan = enemyPlan; }
private void DrawPlayer(INode node, IMazeGraphic graphic, IUnitList unitList, int indeX, int indeY) { IUnit player = unitList.GetPlayer(); var playerRect = new Rectangle( indeX - _defaultSettings.HalfOfUnitSize, indeY - _defaultSettings.HalfOfUnitSize, _defaultSettings.UnitSize, _defaultSettings.UnitSize); player.Draw(graphic, playerRect, node); }
public void Draw(IMazeGraphic mazeGraphic, IMazeViewData mazeView, IUnitList unitList) { ValidateGrapic(mazeGraphic); mazeGraphic.Clear(Color.White); int index = 0; for (int y = mazeView.ViewStart; y <= mazeView.ViewEnd; y++) { for (int x = mazeView.ViewStart; x <= mazeView.ViewEnd; x++) { INode node = mazeView.MazeNodes[index]; DrawNode(x, y, node, mazeGraphic, mazeView, unitList); index++; } } }
public Maze(IUnitList unitList, UnitFactory unitFactory) { UnitList = unitList; _unitFactory = unitFactory; }
public static bool IsPlayerMaximumReached(IUnitList unitList) { var players = unitList.FindUnit(typeof(Player)); return(players.Any()); }
public static bool IsLocationOccupied(Location location, IUnitList unitList) { IUnit unit = unitList.FindUnit(location); return(unit != null); }
public EnemyPlan(ITerrainMap map, IUnitList units, IAlliedEnemyMatrix alliedEnemyMatrix) { _map = map; _units = units; _alliedEnemyMatrix = alliedEnemyMatrix; }
public VictoryCalculator(ITerrainMap terrainMap, IUnitList units) { _terrainMap = terrainMap; _units = units; }
private void DrawNode(int x, int y, INode node, IMazeGraphic graphic, IMazeViewData mazeView, IUnitList unitList) { int indeX = GetNodePoint(x, node.SquareSize, mazeView.ViewStart); int indeY = GetNodePoint(y, node.SquareSize, mazeView.ViewStart); DrawNode(node, graphic, mazeView, indeX, indeY); DrawCollectable(node, graphic, indeX, indeY); DrawPlayer(node, graphic, unitList, indeX, indeY); }
public GameFileReader(ITerrainMap terrainMap, IUnitList unitList) { _terrainMap = terrainMap; _units = unitList; }