private DeckZone GetDeckZone(SabberStoneCore.Model.Zones.DeckZone zone) { var result = new DeckZone(); var span = zone.GetSpan(); for (int i = 0; i < span.Length; i++) { result.Entities.Add(GetPlayable(span[i], true)); } return(result); }
/// <summary>Gets the <see cref="IZone"/> matching the zone identifier.</summary> /// <value>The <see cref="IZone"/>.</value> /// <param name="zone">The zone identifier.</param> /// <returns></returns> /// <exception cref="ZoneException">There is no zone implemented for the provided identifier</exception> public IZone this[Zone zone] { get { IZone result = _zones[(int)zone]; if (result != null) { return(result); } switch (zone) { case Zone.INVALID: result = null; break; case Zone.GRAVEYARD: result = new GraveyardZone(Game, Controller, zone); break; case Zone.PLAY: result = new BoardZone(Game, Controller, zone); break; case Zone.DECK: result = new DeckZone(Game, Controller); break; case Zone.HAND: result = new HandZone(Game, Controller); break; case Zone.SETASIDE: result = new SetasideZone(Game, Controller, zone); break; case Zone.SECRET: result = new SecretZone(Game, Controller, zone); break; case Zone.REMOVEDFROMGAME: break; default: throw new ZoneException("No such zone type when creating zone: " + zone); } _zones[(int)zone] = result; return(result); } }
public DeckZone(SabberZones.DeckZone zone) { var playables = new Playable[10]; var span = zone.GetSpan(); for (int i = 0; i < span.Length; i++) { playables[i] = new Playable(span[i], true); } Count = span.Length; Playables = playables; }
private DeckZone(Controller c, DeckZone zone) : base(c, zone) { NoEvenCostCards = zone.NoEvenCostCards; NoOddCostCards = zone.NoOddCostCards; }
private DeckZone(Controller c, DeckZone zone) : base(c, zone) { NoEvenCostCards = zone.NoEvenCostCards; NoOddCostCards = zone.NoOddCostCards; DrawWithRandom = zone.DrawWithRandom; }
private DeckZone(Controller c, DeckZone zone) : base(c, zone) { Type = Zone.DECK; }