Ejemplo n.º 1
0
        void _createTacticalAdvantage()
        {
            Leader ta = SpawnLeader.TacticalAdvantage(currentPlayer, this);

            AddCardToGame(ta);
            ta.makeVisibleAll();
        }
Ejemplo n.º 2
0
        public override Card spawnCard()
        {
            string methodName = name, callMethodName = "";

            for (int i = 0; i < methodName.Length; ++i)
            {
                if (alphabet.IndexOf(methodName[i]) >= 0)
                {
                    callMethodName += methodName[i];
                }
            }
            SpawnLeader  spun = new SpawnLeader();
            PropertyInfo m    = spun.GetType().GetProperty(callMethodName);

            return(m.GetMethod.Invoke(spun, null) as Leader);
        }
Ejemplo n.º 3
0
        public static List <Card> invokeAllCards()
        {
            SpawnUnit    su = new SpawnUnit();
            SpawnSpecial ss = new SpawnSpecial();
            SpawnLeader  sl = new SpawnLeader();

            List <Type> tps = new List <Type>()
            {
                su.GetType(), ss.GetType(), sl.GetType()
            };
            List <Card> allCardsInGame = new List <Card>();
            int         tIndex         = 0;

            foreach (Type t in tps)
            {
                ++tIndex;
                foreach (var m in t.GetMethods())
                {
                    try
                    {
                        Card c = null;
                        if (tIndex == 1)
                        {
                            c = m.Invoke(su, null) as Card;
                        }
                        if (tIndex == 2)
                        {
                            c = m.Invoke(ss, null) as Card;
                        }
                        if (tIndex == 3)
                        {
                            c = m.Invoke(sl, null) as Card;
                        }
                        if (c != null)
                        {
                            allCardsInGame.Add(c);
                        }
                    }
                    catch (Exception e) { }
                }
            }
            return(allCardsInGame);
        }