public override void SetupCard(Card card, CardTypesLookup cardTypesLookup)
    {
        base.SetupCard(card, cardTypesLookup);
        CardTypesLookupSlotSquadron cardTypesLookupSlotSquadron = cardTypesLookup.squadrons.Find(sqt => sqt.cardTypeRaw == card.cardType);

        if (cardTypesLookupSlotSquadron == null)
        {
            Debug.LogError($"No internal squadron type found for raw type \"{card.cardType}\". Squadron card not set up completely.");
            return;
        }
        squadronType = cardTypesLookupSlotSquadron.squadronType;
    }
    public override void SetupCard(Card card, CardTypesLookup cardTypesLookup)
    {
        base.SetupCard(card, cardTypesLookup);
        CardTypesLookupSlotUpgrade cardTypesLookupSlotUpgrade = cardTypesLookup.upgrades.Find(ut => ut.cardTypeRaw == card.cardType);

        if (cardTypesLookupSlotUpgrade == null)
        {
            Debug.LogError($"No internal upgrade type found for raw type \"{card.cardType}\". Upgrade card not set up completely.");
            return;
        }
        upgradeType = cardTypesLookupSlotUpgrade.upgradeType;
    }
Beispiel #3
0
    public override void SetupCard(Card card, CardTypesLookup cardTypesLookup)
    {
        base.SetupCard(card, cardTypesLookup);
        CardTypesLookupSlotShip cardTypesLookupSlotShip = cardTypesLookup.ships.Find(st => st.cardTypeRaw == card.cardType);

        if (cardTypesLookupSlotShip == null)
        {
            Debug.LogError($"No internal ship type found for raw type \"{card.cardType}\". Ship card not set up completely.");
            return;
        }
        shipType = cardTypesLookupSlotShip.shipType;

        if (card.upgradeSlots != null && card.upgradeSlots.Length > 0)
        {
            upgradeTypes = new UpgradeType[card.upgradeSlots.Length];
            for (int i = 0; i < card.upgradeSlots.Length; i++)
            {
                upgradeTypes[i] = cardTypesLookup.GetUpgradeType(card.upgradeSlots[i]);
            }
        }
    }
Beispiel #4
0
    // private char[] IDEndTrim = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'K', 'L', 'M', 'N', 'O', 'P'};

    public virtual void SetupCard(Card card, CardTypesLookup cardTypesLookup)
    {
        ID     = "card" + card.name.Replace(" ", "").Replace("'", "").Replace("-", "");
        sprite = Resources.Load <Sprite>($"ScannedImages/{card.imageURL.Split('.')[0]}");
        size   = card.size;

        if (card.faction.Length < 1)
        {
            faction = Faction.Empire | Faction.Rebellion;
        }
        else if (card.faction == "emp")
        {
            faction = Faction.Empire;
        }
        else if (card.faction == "reb")
        {
            faction = Faction.Rebellion;
        }
        else
        {
            // No faction, error will be logged
            Debug.LogError($"Base card {card.name} ({card.ID}) defines an invalid faction: {card.faction}");
            faction = (Faction) ~0;
        }

        cardName = card.name;
        cost     = card.cost;

        isCommander = card.isCommander;
        isUnique    = card.isUnique;
        isSquadron  = card.isSquadron;

        cardTypeRaw = card.cardType;

        cardSize = cardTypesLookup.GetCardSize(card.cardType);
    }