コード例 #1
0
        public static DeckInfo ToDeckInfo(this SquadDefinition definition)
        {
            if (!RuntimeData.weaponDefinitions.TryGetValue(definition.weapon.value, out WeaponDefinition value))
            {
                return(null);
            }
            DeckInfo deckInfo = new DeckInfo
            {
                Name   = RuntimeData.FormattedText(63105),
                God    = (int)value.god,
                Weapon = value.get_id()
            };
            IReadOnlyList <Id <CompanionDefinition> > companions = definition.companions;
            int i = 0;

            for (int count = companions.Count; i < count; i++)
            {
                if (RuntimeData.companionDefinitions.TryGetValue(companions[i].value, out CompanionDefinition _))
                {
                    deckInfo.Companions.Add(companions[i].value);
                }
            }
            IReadOnlyList <Id <SpellDefinition> > spells = definition.spells;
            int j = 0;

            for (int count2 = spells.Count; j < count2; j++)
            {
                if (RuntimeData.spellDefinitions.TryGetValue(spells[j].value, out SpellDefinition _))
                {
                    deckInfo.Spells.Add(spells[j].value);
                }
            }
            return(deckInfo);
        }
コード例 #2
0
 public static DataAvailability GetAvailability(SquadDefinition squad)
 {
     foreach (SquadAvailability squad2 in s_instance.squads)
     {
         if (squad2.squad.value == squad.get_id())
         {
             return(squad2.availability);
         }
     }
     return(DataAvailability.NotUsed);
 }