Example #1
0
        public void TestFindGoal1()
        {
            Game.Map = Map_creator.CreateMap(@"
WWWWWWWWWWWWWWWW
WS             W
W              W
W              W
W              W
WWWWWWWWWWWWWWWW", "\n");
            Game.PackMansPosition = new Point(1, 1);
            Assert.AreEqual(Pinky.GetGoal(), new Point(1, 1));
        }
Example #2
0
        public void TestFrightenedMode()
        {
            Game.Map = Map_creator.CreateMap(@"
WWWWWW
W    W
W    W
WP   W
WWWWWW", "\n");
            Game.PackMansPosition = new Point(3, 0);
            Game.CurrentBehavior  = MonsterBehavior.frightened;
            var pinkyPos = new Point(0, 3);
            var pinky    = new Pinky(Directions.Right);
            var res      = new List <CreatureCommand>();

            for (var i = 0; i < 6; i++)
            {
                var a = pinky.Act(pinkyPos.X, pinkyPos.Y);
                pinkyPos.X += a.DeltaX;
                pinkyPos.Y += a.DeltaY;
                res.Add(a);
            }
            Assert.IsNotEmpty(res);
            Assert.AreEqual(res.Count, 6);
        }
Example #3
0
        public void TestScatterMode()
        {
            Game.Map = Map_creator.CreateMap(@"
WWWWWW
W    W
W    W
W    W
W   PW
WWWWWW", "\n");
            Game.PackMansPosition = new Point(4, 1);
            Game.CurrentBehavior  = MonsterBehavior.scatter;
            Game.PointsAtLevel    = 7;
            Game.PointsEated      = 2;
            var pinkyPos = new Point(4, 1);
            var pinky    = new Pinky(Directions.Left);

            for (var i = 0; i < 7; i++)
            {
                var a = pinky.Act(pinkyPos.X, pinkyPos.Y);
                pinkyPos.X += a.DeltaX;
                pinkyPos.Y += a.DeltaY;
            }
            Assert.AreEqual(new Point(1, 1), pinkyPos);
        }