コード例 #1
0
        public ManagerUnits(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings, ManagerEnemies managerEnemies)
        {
            this.managerMouse     = managerMouse;
            this.managerMap       = managerMap;
            this.managerBuildings = managerBuildings;
            this.managerEnemies   = managerEnemies;

            managerMouse.MouseClickEventHandler += ManagerMouse_MouseClickEventHandler;

            units.Add(new Peasant(23, 23, managerMouse, managerMap, managerBuildings, this));

            //for (int i = 0; i < 40; i++)
            //{
            //    units.Add(new ElvenArcher(24, 23, managerMouse, managerMap, managerBuildings, this));
            //}
        }
コード例 #2
0
 public ManagerCombat(ManagerUnits managerUnits, ManagerEnemies managerEnemies, ManagerBuildings managerBuildings)
 {
     this.managerUnits     = managerUnits;
     this.managerEnemies   = managerEnemies;
     this.managerBuildings = managerBuildings;
 }
コード例 #3
0
        public ManagerPlayerUnits(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings, ManagerEnemies managerEnemies)
            : base(managerMouse, managerMap, managerBuildings)
        {
            managerMouse.MouseClickEventHandler += ManagerMouse_MouseClickEventHandler;

            Vector2 goldMinePos = Functions.CleanHalfPosition(managerMap, ManagerBuildings.goldMines[0].position);

            units.Add(new Peasant(Functions.TilePos(goldMinePos.X), Functions.TilePos(goldMinePos.Y), managerMouse, managerMap, this, managerBuildings));
            units.Add(new Knight(Functions.TilePos(goldMinePos.X) - 2, Functions.TilePos(goldMinePos.Y) - 2, managerMouse, managerMap, this, managerBuildings));

            Vector2 pos  = Vector2.Zero;
            Vector2 last = Vector2.Zero;

            for (int j = 0; j < managerMap.FULL_MAP.Count; j++)
            {
                for (int k = 0; k < managerMap.FULL_MAP[j].Count; k++)
                {
                    if (managerMap.FULL_MAP[j][k].tileType != TileType.WATER && !managerMap.FULL_MAP[j][k].isWall && !managerMap.FULL_MAP[j][k].isWater)
                    {
                        pos = managerMap.FULL_MAP[j][k].position;
                    }

                    last = managerMap.FULL_MAP[j][k].position;
                }
            }

            battleship = new Battleship(Functions.TilePos(pos.X), Functions.TilePos(pos.Y), Functions.TilePos(last.X), managerMouse, managerMap, this, managerBuildings, managerEnemies);
        }