示例#1
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);
            }
        }
示例#2
0
 private SetasideZone(Controller c, SetasideZone zone) : base(c, zone)
 {
 }
示例#3
0
 private SetasideZone(Controller c, SetasideZone zone) : base(c, zone)
 {
     Type = Zone.SETASIDE;
 }