Ejemplo n.º 1
0
        static public (VirtualTestUser, SelfCtx) SetupGame(
            PowerCard powerCard,
            Action <GameState> modGameState = null
            )
        {
            var spirit = new TestSpirit(powerCard);
            var gs     = new GameState(spirit, Board.BuildBoardA())
            {
                InvaderDeck = new InvaderDeck(null)                   // Same order every time
            };

            modGameState?.Invoke(gs);

            _ = new SinglePlayer.SinglePlayerGame(gs);

            var user       = new VirtualTestUser(spirit);
            var starterCtx = spirit.Bind(gs);

            // Disable destroying presence
            // starterCtx.GameState.AddBlightSideEffect = (gs,space) => new AddBlightEffect { Cascade=false,DestroyPresence=false };
            starterCtx.GameState.ModifyBlightAddedEffect.ForGame.Add(x => { x.Cascade = false; x.DestroyPresence = false; });


            return(user, starterCtx);
        }
        public void CanBring_2TownDahanExplorer()
        {
            // Setup
            var spirit    = new TestSpirit(PowerCard.For <FlowLikeWaterReachLikeAir>());
            var user      = new VirtualUser(spirit);
            var board     = Board.BuildBoardA();
            var gameState = new GameState(spirit, board);

            gameState.DisableInvaderDeck();
            gameState.Initialize();

            // Given: A5 has 3 Towns, Dahans, and Explorers
            var a5     = board[5];
            var tokens = gameState.Tokens[a5];

            tokens.InitDefault(TokenType.Dahan, 3);
            tokens.InitDefault(Invader.Explorer, 3);
            tokens.InitDefault(Invader.Town, 3);

            //  And: spirit has presence on A5
            spirit.Presence.PlaceOn(a5, gameState);

            //  And: A1 has nothing on it
            var a1 = board[1];