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); }
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); }
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); }
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); }
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); }
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); }
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); }