コード例 #1
0
        private void cleanUpGalaxy()
        {
            foreach (Ship ship in Ships)
            {
                ship.Inventory.ClearInventory();
                ship.Nodes.Clear();
            }
            Ships.Clear();

            foreach (Faction faction in Factions)
            {
                faction.OwnedFactories.Clear();
                faction.OwnedMarkets.Clear();
                faction.OwnedShips.Clear();
                faction.OwnedStations.Clear();
            }

            factions.Clear();

            foreach (StarSystem system in Systems)
            {
                system.Planetoids.Clear();
            }

            Systems.Clear();
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: NMCPLindsay/TBquest2
        public void UpdateInventoryCategories()
        {
            Elixirs.Clear();
            Ships.Clear();
            Weapons.Clear();
            Armor.Clear();

            foreach (var gameItemQuantity in _inventory)
            {
                if (gameItemQuantity.GameObject is Weapons)
                {
                    Weapons.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameObject is Armor)
                {
                    Armor.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameObject is Ship)
                {
                    Ships.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameObject is Elixirs)
                {
                    Elixirs.Add(gameItemQuantity);
                }
            }
        }
コード例 #3
0
ファイル: Player.cs プロジェクト: maksimbulva/HaliteGameBot
        public void UpdateFromInput(int shipCount, int dropoffCount, int halite)
        {
            Halite = halite;

            Ships.Clear();
            for (; shipCount > 0; --shipCount)
            {
                Ships.Add(Factory.CreateShipFromInputLine(Id));
            }

            Dropoffs.Clear();
            for (; dropoffCount > 0; --dropoffCount)
            {
                Dropoffs.Add(Factory.CreateDropoffFromInputLine(Id));
            }
        }
コード例 #4
0
ファイル: PlayerGameModel.cs プロジェクト: joelong01/Catan
        public void Reset()
        {
            _islands                    = new Dictionary <Island, int>();
            Score                       = 0;
            KnightsPlayed               = 0;
            LongestRoad                 = 0;
            TimesTargeted               = 0;
            NoResourceCount             = 0;
            RollsWithResource           = 0;
            MaxNoResourceRolls          = 0;
            GoodRoll                    = false;
            CardsLost                   = 0;
            CardsLostToBaron            = 0;
            CardsLostToSeven            = 0;
            CardsLostToMonopoly         = 0;
            ResourcesAcquired           = 0;
            LargestArmy                 = false;
            HasLongestRoad              = false;
            RoadsPlayed                 = 0;
            ShipsPlayed                 = 0;
            CitiesPlayed                = 0;
            SettlementsPlayed           = 0;
            IslandsPlayed               = 0;
            TotalTime                   = TimeSpan.FromSeconds(0);
            MovedBaronAfterRollingSeven = null;
            PlayedKnightThisTurn        = false;
            Roads.Clear();
            Settlements.Clear();
            Cities.Clear();
            Ships.Clear();
            IsCurrentPlayer = false;
            MaxShips        = 0;
            MaxRoads        = 0;
            MaxSettlements  = 0;
            MaxCities       = 0;
            PlayerTurnResourceCount.OnPlayerResourceUpdate -= OnGameModelResourceUpdate;
            PlayerTurnResourceCount.GameReset();
            Pips       = 0;
            _GoldRolls = new List <List <int> >();

            for (int i = 0; i < _RoadTie.Count(); i++)
            {
                _RoadTie[i] = false;
            }
        }
コード例 #5
0
ファイル: API.cs プロジェクト: mert61/PolskaBotCore
        public void Reconnect()
        {
            Console.WriteLine("Connection lost. Reconnecting.");
            _vanillaClient.pingThread?.Abort();
            Boxes.Clear();
            MemorizedBoxes.Clear();
            Ores.Clear();
            Ships.Clear();
            Gates.Clear();
            Buildings.Clear();
            _proxy.Reset();

            if (_vanillaClient.tcpClient.Connected)
            {
                _vanillaClient.Disconnect();
            }

            _vanillaClient.thread?.Abort();
        }
コード例 #6
0
    void Restart()
    {
        foreach (var planet in Planets)
        {
            Destroy(planet.GameObject);
        }
        Planets.Clear();

        foreach (var ship in Ships)
        {
            Destroy(ship.GameObject);
        }
        Ships.Clear();

        _gameOverText.Text = "";
        IsGameOver         = false;

        Awake();
        Start();
    }
コード例 #7
0
        public void PlaceShip()
        {
            //make 3 big ships (size 4)
            //and put it by design (manually by coder) on the board
            Ships.Clear();
            //Ships.Add(new Ship("Big", 5));
            Ships.Add(new Ship("Small", 3, Alignment.Horizontal));
            Ships.Add(new Ship("Small", 3, Alignment.Vertical));
            Ships.Add(new Ship("Small", 3, Alignment.Horizontal));

            //place ships
            Ships[0].Position[0] = new int[] { 3, 3 }; //D3
            Ships[0].Position[1] = new int[] { 4, 3 }; //E3
            Ships[0].Position[2] = new int[] { 5, 3 }; //F3

            Ships[1].Position[0] = new int[] { 7, 4 }; //H4
            Ships[1].Position[1] = new int[] { 7, 5 }; //H5
            Ships[1].Position[2] = new int[] { 7, 6 }; //H6

            Ships[2].Position[0] = new int[] { 1, 1 }; //B1
            Ships[2].Position[1] = new int[] { 2, 1 }; //C1
            Ships[2].Position[2] = new int[] { 3, 1 }; //D1
        }
コード例 #8
0
ファイル: Board.cs プロジェクト: JoannaMadNat/BattleShip
        public void PlaceShips()
        {
            Ship s1 = new Ship();

            s1.Length = 1;
            Ship s2 = new Ship();

            s2.Length = 2;
            Ship s3 = new Ship();

            s3.Length = 4;

            List <Ship> toPlace = new List <Ship>();

            toPlace.Add(s1);
            toPlace.Add(s2);
            toPlace.Add(s3);

            for (int i = toPlace.Count - 1; i >= 0; i--)
            {
                bool isSuccess = PlaceShip(toPlace[i]);

                if (!isSuccess) //restart everything if loop takes too long
                {
                    Ships.Clear();
                    for (int row = 0; row < Size; ++row)
                    {
                        for (int col = 0; col < Size; ++col)
                        {
                            Cells[row, col] = CellType.Water;
                        }
                    }
                    i = toPlace.Count;
                }
            }
        }
コード例 #9
0
 public void ClearShips()
 {
     Ships.Clear();
 }
コード例 #10
0
ファイル: Fleet.cs プロジェクト: DonRumata710/PlanetWar
 public void RemoveAll()
 {
     Ships.Clear();
 }