public bool Remove(FootballCard card) { if (hand.Contains(card)) { hand.Remove(card); return(true); } return(false); }
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; }
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]) } }; }
public void Insert(ZoneType type, FootballCard card, int position) { var zone = squad[type]; zone.InsertCard(card, position); }
public bool Contains(FootballCard card) => hand.Contains(card);
public void InsertCard(FootballCard card) { hand.Add(card); }
public static double WithAdditionalPower(this Zone zone, FootballCard additional) { var defendPower = zone.DefendPower(); return(defendPower + 0.1 * additional.Rank); }