public static List <ShipModel> GetSortedList(List <ShipModel> ships, SortKey sort_key) { List <ShipModel> range = ships.GetRange(0, ships.get_Count()); switch (sort_key) { case SortKey.LEVEL: range.Sort((ShipModel a, ShipModel b) => DeckUtil._CompLevel(a, b)); break; case SortKey.SHIPTYPE: range.Sort((ShipModel a, ShipModel b) => DeckUtil._CompSType(a, b)); break; case SortKey.DAMAGE: range.Sort((ShipModel a, ShipModel b) => DeckUtil._CompDamage(a, b)); break; case SortKey.NEW: range.Sort((ShipModel a, ShipModel b) => DeckUtil.__CompGetNo(a, b) * -1); break; case SortKey.LEVEL_LOCK: range.Sort((ShipModel a, ShipModel b) => DeckUtil._CompLevelLock(a, b)); break; case SortKey.LOCK_LEVEL: range.Sort((ShipModel a, ShipModel b) => DeckUtil._CompLockLevel(a, b)); break; case SortKey.UNORGANIZED: { Dictionary <int, int> o_map = new Dictionary <int, int>(); for (int i = 1; i <= 8; i++) { Mem_deck mem_deck; if (Comm_UserDatas.Instance.User_deck.TryGetValue(i, ref mem_deck)) { for (int j = 0; j < mem_deck.Ship.Count(); j++) { o_map.Add(mem_deck.Ship[j], i * 10 + j); } } } for (int k = 1; k <= 17; k++) { Mem_esccort_deck mem_esccort_deck; if (Comm_UserDatas.Instance.User_EscortDeck.TryGetValue(k, ref mem_esccort_deck)) { for (int l = 0; l < mem_esccort_deck.Ship.Count(); l++) { o_map.Add(mem_esccort_deck.Ship[l], k * 100 + l); } } } range.Sort((ShipModel a, ShipModel b) => DeckUtil._CompUnOrganize(a, b, o_map)); break; } } return(range); }
public static int __IsInDeck__(int ship_mem_id) { return(DeckUtil.__IsInDeck__(ship_mem_id, true)); }