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()); }
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."); } }
public List <Monster> GetMonstersInAttackPosition() { return(MonsterZones.Where(zone => zone.Monster != null && zone.Monster.Position == CardPosition.FaceUpAttack) .Select(zone => zone.Monster).ToList()); }
public List <Monster> GetMonsters() { return(MonsterZones.Where(zone => zone.Monster != null) .Select(zone => zone.Monster).ToList()); }