Esempio n. 1
0
 public static void UnitChargeTest()
 {
     if (a != null)
     {
         if (a.Health <= 0)
         {
             a = null;
         }
         else
         {
             //a.Charge();
         }
     }
     if (b != null)
     {
         if (b.Health <= 0)
         {
             b = null;
         }
         else
         {
             // b.Charge();
         }
     }
     GraphicsEngine.DrawUnits();
 }
Esempio n. 2
0
        public static void TestInitSides(PictureBox pictureBox)
        {
            GraphicsEngine.Init(pictureBox);

            //leftSide.PopulateGenerals(1, new List<int>[] { new List<int>() { 1 } });
            //leftSide.Generals[0].Armies[0].Units[0].Health = 1000000000;
            //leftSide.Generals[0].Armies[0].Units[0].Radius = 10000000; catapult test.
            //leftSide.Generals[0].Armies[0].Units[0].Damage = 100;

            leftSide.PopulateGenerals(3, new List <int>[] { new List <int>()
                                                            {
                                                                10, 20, 10
                                                            }, new List <int>()
                                                            {
                                                                50, 60
                                                            }, new List <int>()
                                                            {
                                                                70, 80
                                                            } });
            rightSide.PopulateGenerals(2, new List <int>[] { new List <int>()
                                                             {
                                                                 5, 10
                                                             }, new List <int>()
                                                             {
                                                                 20, 50
                                                             } });
            leftSidePen  = new Pen(Color.Red, 2);
            rightSidePen = new Pen(Color.Blue, 2);
            leftSide.MakeTestFormation(50, 100);
            rightSide.MakeTestFormation(500, 400);

            GraphicsEngine.TestDrawSides(leftSide, leftSidePen);
            GraphicsEngine.TestDrawSides(rightSide, rightSidePen);
        }
Esempio n. 3
0
        public static void MeanBlurMap(int blurWidth)
        {
            double[,] kernel = mapGenerator.CreateMeanKernel(blurWidth);
            map = mapGenerator.KernelBlurMap(map, kernel);

            GraphicsEngine.DrawBlackAndWhiteMap(map);
        }
Esempio n. 4
0
        public static void TestChargeArmy()
        {
            GraphicsEngine.ClearCanvas();

            //LeftArmy.Charge(RightArmy);
            //RightArmy.Charge(LeftArmy);
            GraphicsEngine.TestDrawArmy(LeftArmy, LeftArmyPen);
            GraphicsEngine.TestDrawArmy(RightArmy, RightArmyPen);
        }
Esempio n. 5
0
        public static void GuassianBlurMap(int blurWidth)
        {
            //map = mapGenerator.BlurMap(map, blurWidth, blurHeight);

            double[,] kernel = mapGenerator.CreateGuassianKernel(blurWidth);
            map = mapGenerator.KernelBlurMap(map, kernel);

            GraphicsEngine.DrawBlackAndWhiteMap(map);
        }
Esempio n. 6
0
        public static void TestChargeSides()
        {
            GraphicsEngine.ClearCanvas();

            leftSide.Charge(rightSide);
            rightSide.Charge(leftSide);

            GraphicsEngine.TestDrawSides(leftSide, leftSidePen);
            GraphicsEngine.TestDrawSides(rightSide, rightSidePen);
        }
Esempio n. 7
0
        public static void TestChargeGeneral()
        {
            GraphicsEngine.ClearCanvas();

            //leftGeneral.Charge(rightGeneral);
            //rightGeneral.Charge(leftGeneral);

            GraphicsEngine.TestDrawGenerals(leftGeneral, leftGeneralPen);
            GraphicsEngine.TestDrawGenerals(rightGeneral, rightGeneralPen);
        }
Esempio n. 8
0
        public static void UnitTestInit(PictureBox pictureBox)
        {
            GraphicsEngine.Init(pictureBox);
            b.Range  = 2000;
            a.Target = b;
            b.Target = a;

            a.Location = new Point(0, 0);
            b.Location = new Point(200, 300);

            GraphicsEngine.DrawUnits();
        }
Esempio n. 9
0
        public static void TestInitArmy(PictureBox pictureBox)
        {
            GraphicsEngine.Init(pictureBox);

            LeftArmy.PopulateArmy(100);
            RightArmy.PopulateArmy(200);
            LeftArmy.CreateTestFormation(50, 100, 50);
            RightArmy.CreateTestFormation(300, 350, 50);
            LeftArmyPen  = new Pen(Color.Red, 2);
            RightArmyPen = new Pen(Color.Blue, 2);

            GraphicsEngine.TestDrawArmy(LeftArmy, LeftArmyPen);
            GraphicsEngine.TestDrawArmy(RightArmy, RightArmyPen);
        }
Esempio n. 10
0
        public static void TestInitGeneral(PictureBox pictureBox)
        {
            GraphicsEngine.Init(pictureBox);

            leftGeneral.PopulateArmies(2, new int[] { 100, 50 });
            rightGeneral.PopulateArmies(3, new int[] { 100, 100, 150 });
            leftGeneralPen  = new Pen(Color.Red, 2);
            rightGeneralPen = new Pen(Color.Blue, 2);
            leftGeneral.MakeTestFormation(50, 100);
            rightGeneral.MakeTestFormation(300, 500);

            GraphicsEngine.TestDrawGenerals(leftGeneral, leftGeneralPen);
            GraphicsEngine.TestDrawGenerals(rightGeneral, rightGeneralPen);
        }
Esempio n. 11
0
 public static void CreateRandomNoiseMap()
 {
     map = mapGenerator.CreateRandomNoiseMap(GraphicsEngine.canvas.Width, GraphicsEngine.canvas.Height);
     GraphicsEngine.DrawBlackAndWhiteMap(map);
 }
Esempio n. 12
0
 public static void InitMap(PictureBox pictureBox)
 {
     mapGenerator = new MapGenerator();
     GraphicsEngine.Init(pictureBox);
 }