Esempio n. 1
0
        private BoardZone GetBoardZone(SabberStoneCore.Model.Zones.BoardZone zone)
        {
            var result = new BoardZone();
            var span   = zone.GetSpan();

            for (int i = 0; i < span.Length; i++)
            {
                result.Minions.Add(GetMinion(span[i]));
            }
            return(result);
        }
Esempio n. 2
0
        /// <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);
            }
        }
Esempio n. 3
0
        public BoardZone(SabberZones.BoardZone zone)
        {
            var playables = new Minion[7];
            var span      = zone.GetSpan();

            for (int i = 0; i < span.Length; i++)
            {
                playables[i] = new Minion(span[i]);
            }

            Count     = span.Length;
            Playables = playables;
        }
Esempio n. 4
0
        public void Stamp(BoardZone zone)
        {
            zone._hasUntouchables  = _hasUntouchables;
            zone._untouchableCount = _untouchableCount;
            zone._count            = _count;

            for (int i = 0; i < _count; ++i)
            {
                Minion copy = (Minion)Entities[i].Clone(zone.Controller);
                copy.Zone        = zone;
                zone.Entities[i] = copy;
            }
        }