Пример #1
0
 public bool Remove(FootballCard card)
 {
     if (hand.Contains(card))
     {
         hand.Remove(card);
         return(true);
     }
     return(false);
 }
Пример #2
0
 public void InsertCard(FootballCard card, int position)
 {
     if (!cards[position].IsFree)
     {
         throw new InvalidOperationException("This position is not available");
     }
     card.MoveToZone(Type);
     cards[position].Card = card;
 }
Пример #3
0
 public Squad(string name, FootballCard keeper,
              Dictionary <ZoneType, List <FootballCard> > team, string formation)
 {
     Name      = name;
     Formation = formation;
     squad     = new Dictionary <ZoneType, Zone>
     {
         { ZoneType.GK, new Zone(ZoneType.GK, new List <FootballCard> {
                 keeper
             }) },
         { ZoneType.DEF, new Zone(ZoneType.DEF, team[ZoneType.DEF]) },
         { ZoneType.MID, new Zone(ZoneType.MID, team[ZoneType.MID]) },
         { ZoneType.ATT, new Zone(ZoneType.ATT, team[ZoneType.ATT]) }
     };
 }
Пример #4
0
        public void Insert(ZoneType type, FootballCard card, int position)
        {
            var zone = squad[type];

            zone.InsertCard(card, position);
        }
Пример #5
0
 public bool Contains(FootballCard card) => hand.Contains(card);
Пример #6
0
 public void InsertCard(FootballCard card)
 {
     hand.Add(card);
 }
Пример #7
0
        public static double WithAdditionalPower(this Zone zone, FootballCard additional)
        {
            var defendPower = zone.DefendPower();

            return(defendPower + 0.1 * additional.Rank);
        }