public List <ShipModel> GetAreaShips(int area_id, bool use_deck, bool use_edeck, List <ShipModel> all_ships)
        {
            List <ShipModel> list         = new List <ShipModel>();
            MapAreaModel     mapAreaModel = ManagerBase._area.get_Item(area_id);

            if (use_deck)
            {
                DeckModel[] decks = mapAreaModel.GetDecks();
                DeckModel[] array = decks;
                for (int i = 0; i < array.Length; i++)
                {
                    DeckModel deckModel = array[i];
                    list.AddRange(deckModel.GetShips());
                }
            }
            if (use_edeck)
            {
                list.AddRange(mapAreaModel.GetEscortDeck().GetShips());
            }
            HashSet <int> hashSet = mapAreaModel.__GetRepairingShipMemIdsHash__();

            using (HashSet <int> .Enumerator enumerator = hashSet.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int       current = enumerator.get_Current();
                    ShipModel ship2   = this.UserInfo.GetShip(current);
                    if (ship2.IsInDeck() == -1 && ship2.IsInEscortDeck() == -1)
                    {
                        list.Add(ship2);
                    }
                }
            }
            if (all_ships == null)
            {
                all_ships = this.UserInfo.__GetShipList__();
            }
            List <ShipModel> list2 = all_ships.FindAll((ShipModel ship) => ship.IsBlingWait() && ship.AreaIdBeforeBlingWait == area_id);

            list.AddRange(list2);
            return(list);
        }
        public HashSet <int> __GetNDockShipMemIdsHash__()
        {
            HashSet <int> hashSet = new HashSet <int>();

            using (Dictionary <int, MapAreaModel> .ValueCollection.Enumerator enumerator = ManagerBase._area.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    MapAreaModel  current  = enumerator.get_Current();
                    HashSet <int> hashSet2 = current.__GetRepairingShipMemIdsHash__();
                    using (HashSet <int> .Enumerator enumerator2 = hashSet2.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            int current2 = enumerator2.get_Current();
                            hashSet.Add(current2);
                        }
                    }
                }
            }
            return(hashSet);
        }
Exemplo n.º 3
0
        public List <ShipModel> GetAreaShips(int area_id, bool use_deck, bool use_edeck, List <ShipModel> all_ships)
        {
            List <ShipModel> list         = new List <ShipModel>();
            MapAreaModel     mapAreaModel = _area[area_id];

            if (use_deck)
            {
                DeckModel[] decks = mapAreaModel.GetDecks();
                DeckModel[] array = decks;
                foreach (DeckModel deckModel in array)
                {
                    list.AddRange(deckModel.GetShips());
                }
            }
            if (use_edeck)
            {
                list.AddRange(mapAreaModel.GetEscortDeck().GetShips());
            }
            HashSet <int> hashSet = mapAreaModel.__GetRepairingShipMemIdsHash__();

            foreach (int item in hashSet)
            {
                ShipModel ship2 = UserInfo.GetShip(item);
                if (ship2.IsInDeck() == -1 && ship2.IsInEscortDeck() == -1)
                {
                    list.Add(ship2);
                }
            }
            if (all_ships == null)
            {
                all_ships = UserInfo.__GetShipList__();
            }
            List <ShipModel> collection = all_ships.FindAll((ShipModel ship) => ship.IsBlingWait() && ship.AreaIdBeforeBlingWait == area_id);

            list.AddRange(collection);
            return(list);
        }