Esempio n. 1
0
        public int GetTotalItemsQueuedStorageUsedByRoomDesign(RoomDesign roomDesign)
        {
            int num = 0;

            for (int index1 = 0; index1 < this.Rooms.Length; ++index1)
            {
                PSMainRoom room = this.Rooms[index1] as PSMainRoom;
                if (room.RoomStatus != RoomStatus.Inventory && room.RoomStatus != RoomStatus.Inventory && (room.RoomDesign.ItemRank == roomDesign.ItemRank && room.RoomDesign.ManufactureType == roomDesign.ManufactureType) && room.ManufactureString != string.Empty)
                {
                    List <PSResourceGroup> psResourceGroupList = new List <PSResourceGroup>();
                    for (int index2 = 0; index2 < room.ManufactureItemQueue.Count; ++index2)
                    {
                        PSResourceGroup manufactureItem = room.ManufactureItemQueue[index2];
                        if (!psResourceGroupList.Contains(manufactureItem))
                        {
                            psResourceGroupList.Add(manufactureItem);
                        }
                    }
                    for (int index2 = 0; index2 < psResourceGroupList.Count; ++index2)
                    {
                        PSResourceGroup psResourceGroup = psResourceGroupList[index2];
                        ItemDesign      itemDesignById  = SingletonManager <ItemManager> .Instance.GetItemDesignByID(psResourceGroup.resourceId);

                        num += itemDesignById.ItemSpace * psResourceGroup.quantity;
                    }
                }
            }
            return(num);
        }
Esempio n. 2
0
        public int GetMaxCapacityByItemDesign(ItemDesign itemDesign)
        {
            int num = 0;

            for (int index = 0; index < this.Rooms.Length; ++index)
            {
                PSRoom room = this.Rooms[index];
                if (room.RoomStatus != RoomStatus.Inventory && room.RoomStatus != RoomStatus.Building && (room.RoomDesign.ItemRank == itemDesign.Rank && room.RoomDesign.ManufactureType == itemDesign.ItemType))
                {
                    num += room.RoomDesign.Capacity;
                }
            }
            return(num);
        }
Esempio n. 3
0
        public int GetTotalItemsStorageUsedByItemDesign(ItemDesign itemDesign)
        {
            int           num = 0;
            List <PSItem> itemsBelongingToShip = this.ItemsBelongingToShip;

            for (int index = 0; index < itemsBelongingToShip.Count; ++index)
            {
                PSItem psItem = itemsBelongingToShip[index];
                if (psItem.ItemDesign.ItemType == itemDesign.ItemType && psItem.ItemDesign.Rank == itemDesign.Rank && (psItem.ItemDesign.RequiredResearchDesignId == 0 || psItem.ItemDesign.RequiredPsResearch != null && psItem.ItemDesign.RequiredPsResearch.ResearchState == ResearchState.Completed))
                {
                    num += psItem.ItemDesign.ItemSpace * psItem.Quantity;
                }
            }
            return(num);
        }