Пример #1
0
 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;
 }
Пример #2
0
        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);
        }
Пример #3
0
        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++;
                }
            }
        }
Пример #4
0
 public Maze(IUnitList unitList, UnitFactory unitFactory)
 {
     UnitList     = unitList;
     _unitFactory = unitFactory;
 }
Пример #5
0
        public static bool IsPlayerMaximumReached(IUnitList unitList)
        {
            var players = unitList.FindUnit(typeof(Player));

            return(players.Any());
        }
Пример #6
0
        public static bool IsLocationOccupied(Location location, IUnitList unitList)
        {
            IUnit unit = unitList.FindUnit(location);

            return(unit != null);
        }
Пример #7
0
 public EnemyPlan(ITerrainMap map, IUnitList units, IAlliedEnemyMatrix alliedEnemyMatrix)
 {
     _map               = map;
     _units             = units;
     _alliedEnemyMatrix = alliedEnemyMatrix;
 }
Пример #8
0
 public VictoryCalculator(ITerrainMap terrainMap, IUnitList units)
 {
     _terrainMap = terrainMap;
     _units      = units;
 }
Пример #9
0
        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);
        }
Пример #10
0
 public GameFileReader(ITerrainMap terrainMap, IUnitList unitList)
 {
     _terrainMap = terrainMap;
     _units      = unitList;
 }