+\r
+ private void InjectShips(int deck, int[] nowhps, int[] maxhps, int[][] slots)\r
+ {\r
+ var id = _shipInfo.Keys.Count + 1;\r
+ var ships = nowhps.Zip(maxhps,\r
+ (now, max) => new ShipStatus {Id = id++, NowHp = now, MaxHp = max}).ToArray();\r
+ _decks[deck] = (from ship in ships select ship.Id).ToArray();\r
+ foreach (var ship in ships)\r
+ _shipInfo[ship.Id] = ship;\r
+ foreach (var entry in ships.Zip(slots, (ship, slot) =>new {ship, slot}))\r
+ {\r
+ entry.ship.Slot = _itemInfo.InjectItems(entry.slot.Take(5)).ToArray();\r
+ if (entry.slot.Length >= 6)\r
+ entry.ship.SlotEx = _itemInfo.InjectItems(entry.slot.Skip(5)).First();\r
+ }\r
+ }\r