예제 #1
0
    public override void Execute(Action action)
    {
        Card card;

        //THe case of a deal card being send before a creat rune, EX.(A card in the other persons hand)
        if (EntityManager.Singelton.GetEntity(cardGuid) != null)
        {
            CardAvatar ca = (EntityManager.Singelton.GetEntity(cardGuid) as Card).GetCardAvatar();
            Debug.Log(ca);
            EntityManager.Singelton.RemoveEntity(cardGuid);
            if (type == CardType.minion)
            {
                card = new MinionCard();
                MinionCard mc = card as MinionCard;
                CardDataLoader.CardData cd = CardDataLoader.Singelton.GetCardData(id);

                mc.SetName(cd.cardName);
                mc.SetArt(cd.art);
                mc.SetBaseAttack(baseAttack);
                mc.SetBaseHealth(baseHealth);
                mc.SetMana(cost);
                mc.SetGuid(cardGuid);
                mc.SetDesc(cd.desc);
                mc.SetCardAvatar(ca);
                EntityManager.Singelton.AddEntity(cardGuid, mc);
                ca.Setup(card, cardGuid, controllerGuid);
            }
        }
        else
        {
            if (type == CardType.minion)
            {
                MinionCard mc = new MinionCard();
                CardDataLoader.CardData cd = CardDataLoader.Singelton.GetCardData(id);
                mc.SetCardText(cd.cardText);
                mc.SetName(cd.cardName);
                mc.SetArt(cd.art);
                mc.SetBaseAttack(baseAttack);
                mc.SetBaseHealth(baseHealth);
                mc.SetMana(cost);
                mc.SetGuid(cardGuid);
                mc.SetDesc(cd.desc);
                EntityManager.Singelton.AddEntity(cardGuid, mc);
            }
            else if (type == CardType.spell)
            {
                SpellCard sc = new SpellCard();
                CardDataLoader.CardData cd = CardDataLoader.Singelton.GetCardData(id);

                sc.SetName(cd.cardName);
                sc.SetArt(cd.art);
                sc.SetMana(cost);
                sc.SetDesc(cd.desc);
                sc.SetGuid(cardGuid);
                sc.SetCardType((int)type);
                EntityManager.Singelton.AddEntity(cardGuid, sc);
            }
        }
        action();
    }
예제 #2
0
    public override void Execute(Action action)
    {
        Card card;

        //Not sure but I think I might not need this anymore??
        if (EntityManager.Singelton.GetEntity(uid) != null)
        {
            CardAvatar ca = (EntityManager.Singelton.GetEntity(uid) as Card).GetCardAvatar();
            EntityManager.Singelton.RemoveEntity(uid);
            card = new MinionCard();
            MinionCard mc = card as MinionCard;
            CardDataLoader.CardData cd = CardDataLoader.Singelton.GetCardData(id);

            mc.SetName(cd.cardName);
            mc.SetBaseAttack(base_attack);
            mc.SetBaseHealth(base_health);
            mc.SetMana(cost);
            mc.SetGuid(uid);
            mc.SetDesc(cd.desc);
            mc.SetCardAvatar(ca);
            EntityManager.Singelton.AddEntity(uid, mc);
            ca.Setup(card, uid, controller_uid);
        }
        else
        {
            MinionCard mc = new MinionCard();
            CardDataLoader.CardData cd = CardDataLoader.Singelton.GetCardData(id);
            mc.SetCardText(cd.cardText);
            mc.SetName(cd.cardName);
            mc.SetArt(cd.art);
            mc.SetBaseAttack(base_attack);
            mc.SetBaseHealth(base_health);
            mc.SetMana(cost);
            mc.SetGuid(uid);
            mc.SetDesc(cd.desc);
            EntityManager.Singelton.AddEntity(uid, mc);
        }


        action();
    }
예제 #3
0
 public JSONObject LoadServerData(CardDataLoader.CardData cardData)
 {
     return(null);
 }