Exemple #1
0
        public void LaunchWithoutAllPilots()
        {
            _game.DockedPilots[1] = 1;
            _game.Credits[1]      = 5;
            var ship = new Ship(_game, string.Empty, 10, 10, System.Drawing.Color.DimGray, 2, 1, 10, 2, 0);

            _game.LaunchShip(ship);
            _game.DockedPilots[1].ShouldBe(1);
        }
Exemple #2
0
        private static CombatShip LaunchShipType(StrategyGame game, EShipType[] types, Base launchBase, Ship.ShipEventHandler f_ShipEvent)
        {
            var team = launchBase.Team;
            var colour = Color.FromArgb(game.GameSettings.TeamColours[team - 1]);
            var ship = game.Ships.CreateCombatShip(types, team, colour, launchBase.SectorId);
            if (ship == null) return null;
            if (!game.LaunchShip(ship)) return null;

            var pos = launchBase.GetNextBuildPosition();
            ship.CenterX = launchBase.CenterX;
            ship.CenterY = launchBase.CenterY;
            ship.ShipEvent += f_ShipEvent;
            ship.OrderShip(new MoveOrder(game, launchBase.SectorId, pos, Point.Empty));
            
            return ship;
        }