public void Test_G()
 {
     GameDetail game = new GameDetail();
     String msg = "G:P1;0,0;0;0;100;0;0:8,6,0;4,8,0;9,3,0;3,1,0;5,7,0#";
     game.processMsg(msg,new TimeSpan(0));
     //Assert.AreEqual(game.players[1].name, "P1");
     //Assert.AreEqual(game.,)
 }
 public DrawingManager(GraphicsDeviceManager graphics, ContentManager content,GameDetail gameDetail)
 {
     device = graphics.GraphicsDevice;
     this.content = content;
     this.graphics = graphics;
     screenHeight = graphics.PreferredBackBufferHeight;
     screenWidth = graphics.PreferredBackBufferWidth;
     this.gameDetail = gameDetail;
 }
        public void Test_GetPath_Method()
        {
            GameDetail game = new GameDetail();
            game.processMsg("I:P0:9,3;7,4;4,2;6,8;2,4;4,7;5,3;1,3;3,8;8,6:4,8;6,3;3,2;5,7;3,6;5,8;8,1;2,1;8,4;7,1:1,8;0,3;1,4;0,8;3,1;2,6;2,7;1,7;4,3;7,6#", new TimeSpan(0));

            List<int> path = TaskManager.getPath(game, 0, 2);

            Assert.AreEqual(0, 0);
            //Assert.AreEqual(game.,)
        }
        public void Test_GetMoveNew_Method()
        {
            GameDetail game = new GameDetail();
            game.processMsg("I:P0:9,3;7,4;4,2;6,8;2,4;4,7;5,3;1,3;3,8;8,6:4,8;6,3;3,2;5,7;3,6;5,8;8,1;2,1;8,4;7,1:1,8;0,3;1,4;0,8;3,1;2,6;2,7;1,7;4,3;7,6#", new TimeSpan(0));
            game.thisPlayer.x = 0;
            game.thisPlayer.y = 0;

            String move = TaskManager.getMoveNew(game);

            Assert.AreEqual("0", move);
            //Assert.AreEqual(game.,)
        }
Exemple #5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            //Graphic initialize
            device = graphics.GraphicsDevice;
            graphics.PreferredBackBufferWidth = 1000;
            graphics.PreferredBackBufferHeight = 600;

            screenWidth = graphics.PreferredBackBufferWidth;
            screenHeight = graphics.PreferredBackBufferHeight;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();
            Window.Title = "Crash & Burn";

            //Game Details
            gameDetail = new GameDetail();
            drawingManager = new DrawingManager(graphics,this.Content,gameDetail);
            msgSender = new Game.AI.MessageSender(networkClient);

            //Keyboard Dispatcher
            keyboard_dispatcher = new KeyboardDispatcher(this.Window);

            Constant.Load();

            base.Initialize();
        }