Ejemplo n.º 1
0
        public PackMovementLastZone()
        {
            Predicate <Game> p = (P => playerLastZone(P) && allPacksOk());
            Predicate <Game> q = (Q => !playerLastZone(Q));

            unless = new Unless(p, q);
        }
Ejemplo n.º 2
0
        public Allerted()
        {
            zone = 1;
            Predicate <Game> p = (G => G.player.inCombat || Specification.AllNodesInzone(G.dungeon.zone[zone], pNodes));
            Predicate <Game> q = (G => G.player.zone != zone);

            unless = new Unless(p, q);
        }
Ejemplo n.º 3
0
 public void RAlert()
 {
     GamePlay[] runs = loadRuns();
     foreach (var run in runs)
     {
         uint level = run.getState().dungeon.difficultyLevel;
         for (int i = 1; i <= level + 1; i++)
         {
             var s = new Unless(_ => Dungeon.alert == i, g => g.player.level != i);
             Assert.IsTrue(run.Replay(s));
         }
     }
 }
Ejemplo n.º 4
0
        public void Unless_RAlert_Test()
        {
            List <GamePlay> plays = loadSavedGamePlays(allReplays);

            foreach (GamePlay gp in plays)
            {
                // test that this specifation is respected by each game-play:
                Game          game       = gp.getGame();
                bool[]        zone_alert = new bool[game.dungeon.difficultyLevel + 2];
                Specification S          = new Unless(G => contested_then_alert(G, zone_alert), G => player_other_zone(G, zone_alert));
                gp.replay(S);
                Assert.IsTrue(S.getVerdict());
            }
        }
Ejemplo n.º 5
0
        public void UnlessPredicate()
        {
            List <GamePlay> plays = loadSavedGamePlays(new List <string>()
            {
                "Combat1", "End"
            });

            foreach (GamePlay gp in plays)
            {
                // test that this specifation is respected by each game-play:
                int           M = (int)gp.numberOfMonsters;
                Specification S = new Unless(G => countMonsters(G) == M, G => countMonsters(G) < M);
                Console.WriteLine("Test");
                gp.replay(S);
                Assert.IsTrue(S.getVerdict());
            }
        }