Esempio n. 1
0
 public List <Monster> GetMonstersInDefensePosition()
 {
     return(MonsterZones.Where(zone =>
                               zone.Monster != null &&
                               (zone.Monster.Position == CardPosition.FaceDownDefense ||
                                zone.Monster.Position == CardPosition.FaceUpDefense))
            .Select(zone => zone.Monster).ToList());
 }
Esempio n. 2
0
        public void TributeSummon(Monster monster)
        {
            var requiredTributes = 0;

            if (monster.Level == 5 || monster.Level == 6)
            {
                requiredTributes = 1;
            }
            if (monster.Level >= 7)
            {
                requiredTributes = 2;
            }

            var monstersOnBoard = MonsterZones.Where(z => z.Monster != null).Count();

            if (monstersOnBoard < requiredTributes)
            {
                throw new Exception("Not enough monsters on the field to tribute.");
            }
        }
Esempio n. 3
0
 public List <Monster> GetMonstersInAttackPosition()
 {
     return(MonsterZones.Where(zone => zone.Monster != null &&
                               zone.Monster.Position == CardPosition.FaceUpAttack)
            .Select(zone => zone.Monster).ToList());
 }
Esempio n. 4
0
 public List <Monster> GetMonsters()
 {
     return(MonsterZones.Where(zone => zone.Monster != null)
            .Select(zone => zone.Monster).ToList());
 }