Esempio n. 1
0
 public void MonsterAttack(Game game, Player player, Player enemy, Monster monster, int monsterindex1, int monsterindex2)
 {
     monster.OnAttack(game, player, enemy);
     FieldVisitor.removeCardFromField(monsterindex1, game, player, enemy, game.field1.monsterfield, ref game.field1.monsterfieldCount);
     FieldVisitor.removeCardFromField(monsterindex2, game, enemy, player, game.field2.monsterfield, ref game.field2.monsterfieldCount);
     //game.field1.removeCardFromMonsterField(monsterindex1, game, player, enemy);
     //game.field2.removeCardFromMonsterField(monsterindex2, game, player, enemy);
 }
Esempio n. 2
0
        public void PlayCardFromHand(string playerId, int index)
        {
            if (player1.id.ToString() == playerId)
            {
                //Card c = field1.removeCardFromHandField(index);
                Card c = FieldVisitor.removeCardFromField(index, null, null, null, field1.handfield, ref field1.handfieldCount);
                if (c.type == Enums.CardTypes.Monster)
                {
                    Monster   monster = (Monster)c;
                    Monster[] cs      = { monster };
                    //field1.insertCardsIntoMonsterField(cs, this, player1, player2);
                    FieldVisitor.insertCardsIntoField(cs, this, player1, player2, field1.monsterfield, ref field1.monsterfieldCount);
                }

                else if (c.type == Enums.CardTypes.Spell)
                {
                    Spell   spell = (Spell)c;
                    Spell[] cs    = { spell };
                    //field1.insertCardsIntoSpellField(cs);
                    FieldVisitor.insertCardsIntoField(cs, null, null, null, field1.trapfield, ref field1.trapfieldCount);
                }
                else if (c.type == Enums.CardTypes.Trap)
                {
                    Trap   trap = (Trap)c;
                    Trap[] cs   = { trap };
                    //field1.insertCardsIntoSpellField(cs);
                    FieldVisitor.insertCardsIntoField(cs, null, null, null, field1.trapfield, ref field1.trapfieldCount);
                }
            }
            if (player2.id.ToString() == playerId)
            {
                //Card c = field2.removeCardFromHandField(index);
                Card c = FieldVisitor.removeCardFromField(index, null, null, null, field2.handfield, ref field2.handfieldCount);
                if (c.type == Enums.CardTypes.Monster)
                {
                    Monster   monster = (Monster)c;
                    Monster[] cs      = { monster };
                    //field2.insertCardsIntoMonsterField(cs, this, player2, player1);
                    FieldVisitor.insertCardsIntoField(cs, this, player2, player1, field2.monsterfield, ref field2.monsterfieldCount);
                }

                else if (c.type == Enums.CardTypes.Spell)
                {
                    Spell   spell = (Spell)c;
                    Spell[] cs    = { spell };
                    //field2.insertCardsIntoSpellField(cs);
                    FieldVisitor.insertCardsIntoField(cs, null, null, null, field2.trapfield, ref field2.trapfieldCount);
                }
                else if (c.type == Enums.CardTypes.Trap)
                {
                    Trap   trap = (Trap)c;
                    Trap[] cs   = { trap };
                    //field2.insertCardsIntoSpellField(cs);
                    FieldVisitor.insertCardsIntoField(cs, null, null, null, field2.trapfield, ref field2.trapfieldCount);
                }
            }
        }
Esempio n. 3
0
 public void DestroyMonster(Game game, Guid playerId, Guid enemyid, int index)
 {
     if (player1.id == playerId)
     {
         //field1.removeCardFromMonsterField(index, game, player1, player2);
         FieldVisitor.removeCardFromField(index, game, player1, player2, field1.monsterfield, ref field1.monsterfieldCount);
     }
     if (player2.id == playerId)
     {
         //field2.removeCardFromMonsterField(index, game, player2, player1);
         FieldVisitor.removeCardFromField(index, game, player2, player1, field2.monsterfield, ref field2.monsterfieldCount);
     }
 }