예제 #1
0
        private static Paintball ParsePaintball(string[] mapObject)
        {
            float     locationX = float.Parse(mapObject[1]);
            float     locationY = float.Parse(mapObject[2]);
            Paintball paintball = new Paintball(new PointF(locationX, locationY));

            return(paintball);
        }
예제 #2
0
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     Paintball ___test = new Paintball();
     ___test.run_test(-1);
     try {
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
예제 #3
0
// END CUT HERE
// BEGIN CUT HERE
    public static void Main()
    {
        Paintball ___test = new Paintball();

        ___test.run_test(-1);
        try {
        } catch (Exception e) {
//Console.WriteLine(e.StackTrace);
            Console.WriteLine(e.ToString());
        }
    }
예제 #4
0
        public void CreatePaintball()
        {
            PointF location = new PointF(100, 100);
            PointF velocity = new PointF(15, 5);

            _paintball = new Paintball(location, velocity);
            Assert.AreEqual(_paintball.Location.X, 100);
            Assert.AreEqual(_paintball.Location.Y, 100);

            Assert.AreEqual(_paintball.Velocity.X, 15);
            Assert.AreEqual(_paintball.Velocity.Y, 5);
        }
예제 #5
0
        public void RenderPaintballTest()
        {
            Paintball paintball      = new Paintball(new PointF(100, 100));
            Bitmap    actualImage    = new Bitmap(800, 600);
            Graphics  actualGraphics = Graphics.FromImage(actualImage);

            actualGraphics.Clear(Color.Black);
            paintball.Render(actualGraphics);
            actualImage.Save("../../RenderingActual/paintball.bmp");

            Bitmap expectedImage = (Bitmap)Bitmap.FromFile("../../RenderingExpected/paintball.bmp");

            VerifyPictureIsTheSame(expectedImage, actualImage);

            actualImage.Dispose();
            expectedImage.Dispose();
        }
예제 #6
0
 public Game()
 {
     thePoint = new Point(50, 50);
     gun      = new Paintball(thePoint);
 }