示例#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;
        }
示例#3
0
        private static Game CreatePartiallyObservableGame(Game fullGame)
        {
            Game game = fullGame.Clone();

            SabberStoneCore.Model.Entities.Controller op   = game.CurrentOpponent;
            SabberStoneCore.Model.Entities.Controller p    = game.CurrentPlayer;
            SabberStoneCore.Model.Zones.HandZone      hand = op.HandZone;
            int opHandCount = hand.Count;

            for (int i = 0; i < opHandCount; i++)
            {
                int id = hand[0].Id;
                hand.Remove(0);
                hand.Add(new Unknown(in op, PlaceHolder, id));
            }
            game.AuraUpdate();
            int opDeckCount = op.DeckZone.Count;

            for (int i = 0; i < opDeckCount; i++)
            {
                int id = op.DeckZone[i].Id;
                op.DeckZone[i].ActivatedTrigger?.Remove();
                op.DeckZone.Remove(0);
                op.DeckZone.Add(new Unknown(in op, PlaceHolder, id));
            }
            int myDeckCount = p.DeckZone.Count;

            for (int i = 0; i < myDeckCount; i++)
            {
                int id = p.DeckZone[i].Id;
                p.DeckZone[i].ActivatedTrigger?.Remove();
                p.DeckZone.Remove(0);
                p.DeckZone.Add(new Unknown(in p, PlaceHolder, id));
            }
            return(game);
        }