示例#1
0
        private static Game CreatePartiallyObservableGame(Game fullGame)
        {
            Game game = fullGame.Clone();

            SabberStoneCore.Model.Entities.Controller op   = game.CurrentOpponent;
            SabberStoneCore.Model.Zones.HandZone      hand = op.HandZone;
            ReadOnlySpan <IPlayable> span = hand.GetSpan();

            for (int i = span.Length - 1; i >= 0; --i)
            {
                hand.Remove(span[i]);
                hand.Add(new Unknown(in op, PlaceHolder, span[i].Id));
            }
            game.AuraUpdate();
            span = op.DeckZone.GetSpan();
            for (int i = 0; i < span.Length; i++)
            {
                span[i].ActivatedTrigger?.Remove();
            }
            var deck = new SabberStoneCore.Model.Zones.DeckZone(op);

            for (int i = 0; i < span.Length; i++)
            {
                span[i].ActivatedTrigger?.Remove();
                deck.Add(new Unknown(in op, PlaceHolder, span[i].Id));
            }
            op.DeckZone = deck;
            return(game);
        }
示例#2
0
        public HandZone(SabberStoneCore.Model.Zones.HandZone zone)
        {
            var playables = new RepeatedField <Playable>();
            var span      = zone.GetSpan();

            for (int i = 0; i < span.Length; i++)
            {
                playables.Add(new Playable(span[i], true));
            }

            entities_ = playables;
        }