Example #1
0
        private static void TestHolder()
        {
            s = new StateEngine(@"../../output/Tests/Test/state.json");

            string move = s.TryDodge();
            Console.WriteLine("Dodge: " + move);
            move = s.TryShoot();
            Console.WriteLine("Shoot: " + move);
            move = s.TryBuild();
            Console.WriteLine("Build: " + move);
            move = s.TryPlace();
            Console.WriteLine("Place: " + move);
            move = s.TryShift();
            Console.WriteLine("Shift: " + move);
        }
Example #2
0
        private static void TestHolder()
        {
            s = new StateEngine(@"../../output/Tests/Test/state.json");

            string move = s.TryDodge();

            Console.WriteLine("Dodge: " + move);
            move = s.TryShoot();
            Console.WriteLine("Shoot: " + move);
            move = s.TryBuild();
            Console.WriteLine("Build: " + move);
            move = s.TryPlace();
            Console.WriteLine("Place: " + move);
            move = s.TryShift();
            Console.WriteLine("Shift: " + move);
        }
Example #3
0
        private string CreateMove()
        {
            if (state.Deity == null)
            {
                return("Nothing");
            }

            string move = state.TryDodge();

            if (move != null)
            {
                return(move);
            }

            move = state.TryShoot();

            if (move != null)
            {
                return(move);
            }

            move = state.TryBuild();

            if (move != null)
            {
                return(move);
            }

            move = this.state.TryPlace();

            if (move != null)
            {
                return(move);
            }

            move = this.state.TryShift();

            if (move != null)
            {
                return(move);
            }

            //move = state.TryBuild();
            //return GetRandomMove();
            return(CharonBot.Moves.Nothing.ToString());
        }
Example #4
0
        public static void TestBuilding()
        {
            // No tests now as this will change a lot

            s = new StateEngine(@"../../output/Tests/TestBuildFullLivesStandardShields/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, first round of game (Expected: BuildShield) - " + result);
            if (!result.Equals("BuildShield")) Debugger.Break();

            s = new StateEngine(@"../../output/Tests/TestBuildShieldBlockage1/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null && result.Equals("BuildShield")) Debugger.Break();

            s = new StateEngine(@"../../output/Tests/TestBuildShieldBlockage2/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null && result.Equals("BuildShield")) Debugger.Break();

            s = new StateEngine(@"../../output/Tests/TestBuildShieldBlockage3/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null && result.Equals("BuildShield")) Debugger.Break();

            s = new StateEngine(@"../../output/Tests/TestBuildMissileControllerBlockage/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null) Debugger.Break();

            s = new StateEngine(@"../../output/Tests/TestBuildNotBehindShields/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, not behind shields. Should never be MC or AF - " + result);
            if (result != null) Debugger.Break();

            s = new StateEngine(@"../../output/Tests/TestBuildBehindShieldNoMC/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build behind shield (Expected: BuildMissileController) - " + result);
            if (!result.Equals("BuildMissileController")) Debugger.Break();

            s = new StateEngine(@"../../output/Tests/TestBuildBehindShieldHaveMC/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build behind shield (Expected: BuildAlienFactory) - " + result);
            if (!result.Equals("BuildAlienFactory")) Debugger.Break();
        }
Example #5
0
        public static void TestBuilding()
        {
            // No tests now as this will change a lot

            s      = new StateEngine(@"../../output/Tests/TestBuildFullLivesStandardShields/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, first round of game (Expected: BuildShield) - " + result);
            if (!result.Equals("BuildShield"))
            {
                Debugger.Break();
            }

            s      = new StateEngine(@"../../output/Tests/TestBuildShieldBlockage1/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null && result.Equals("BuildShield"))
            {
                Debugger.Break();
            }

            s      = new StateEngine(@"../../output/Tests/TestBuildShieldBlockage2/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null && result.Equals("BuildShield"))
            {
                Debugger.Break();
            }

            s      = new StateEngine(@"../../output/Tests/TestBuildShieldBlockage3/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null && result.Equals("BuildShield"))
            {
                Debugger.Break();
            }

            s      = new StateEngine(@"../../output/Tests/TestBuildMissileControllerBlockage/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, stuff in way (Expected: null - " + result);
            if (result != null)
            {
                Debugger.Break();
            }

            s      = new StateEngine(@"../../output/Tests/TestBuildNotBehindShields/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build, not behind shields. Should never be MC or AF - " + result);
            if (result != null)
            {
                Debugger.Break();
            }

            s      = new StateEngine(@"../../output/Tests/TestBuildBehindShieldNoMC/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build behind shield (Expected: BuildMissileController) - " + result);
            if (!result.Equals("BuildMissileController"))
            {
                Debugger.Break();
            }

            s      = new StateEngine(@"../../output/Tests/TestBuildBehindShieldHaveMC/state.json");
            result = s.TryBuild();
            Console.WriteLine("Try build behind shield (Expected: BuildAlienFactory) - " + result);
            if (!result.Equals("BuildAlienFactory"))
            {
                Debugger.Break();
            }
        }