예제 #1
0
        public int GetCapacityOfItem(ItemType itemType, int itemRank)
        {
            int num = 0;

            for (int index = 0; index < this.Rooms.Length; ++index)
            {
                PSRoom     room       = this.Rooms[index];
                RoomDesign roomDesign = room.RoomDesign;
                if (roomDesign.ManufactureType == itemType && roomDesign.ItemRank == itemRank && (room.RoomStatus == RoomStatus.Normal || room.RoomStatus == RoomStatus.Upgrading))
                {
                    num += roomDesign.Capacity;
                }
            }
            switch (itemType)
            {
            case ItemType.Mineral:
                num += this.ShipDesign.MineralCapacity;
                break;

            case ItemType.Gas:
                num += this.ShipDesign.GasCapacity;
                break;
            }
            return(num);
        }
예제 #2
0
 public PSRoom GetRoomByRoomId(int roomId)
 {
     for (int index = 0; index < this.Rooms.Length; ++index)
     {
         PSRoom room = this.Rooms[index];
         if (room.RoomId == roomId)
         {
             return(room);
         }
     }
     return((PSRoom)null);
 }
예제 #3
0
 public bool HasRoomOfType(RoomType roomType)
 {
     for (int index = 0; index < this.Rooms.Length; ++index)
     {
         PSRoom room = this.Rooms[index];
         if (room.RoomType == roomType && (room.RoomStatus == RoomStatus.Normal || room.RoomStatus == RoomStatus.Upgrading))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #4
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);
        }
예제 #5
0
        public int CountPlacedRoomsOfType(RoomType type)
        {
            int num = 0;

            for (int index = 0; index < this.Rooms.Length; ++index)
            {
                PSRoom room = this.Rooms[index];
                if (room.RoomStatus != RoomStatus.Inventory && room.RoomType == type)
                {
                    ++num;
                }
            }
            return(num);
        }
예제 #6
0
        public int GetNumberOfRoomsOfSameDesignInInventory(int roomDesignId)
        {
            int num = 0;

            for (int index = 0; index < this.Rooms.Length; ++index)
            {
                PSRoom room = this.Rooms[index];
                if (room.RoomStatus == RoomStatus.Inventory && room.RoomDesignId == roomDesignId)
                {
                    ++num;
                }
            }
            return(num);
        }
예제 #7
0
        public int GetTotalNumberOfItemsOfTypeEquippedOnRooms(PSItem psItem)
        {
            int num1 = 0;

            for (int index = 0; index < this.Rooms.Length; ++index)
            {
                PSRoom room = this.Rooms[index];
                if (room.ModuleItems != null && room.ModuleItems.Count > 0)
                {
                    int num2 = room.ModuleItems.Count <PSItem>((Func <PSItem, bool>)(mod => mod.ItemId == psItem.ItemId));
                    num1 += num2;
                }
            }
            return(num1);
        }