Esempio n. 1
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     // The game terrain
     active_grid = new MainGrid();
     // Receive messages from server and update the grid
     msghandler = new MessageHandler(active_grid);
     // Send messages to the server and play the game
     msgSender = new MessageSender(msghandler);
     // Initiating the Game AI
     gameAI = new GameAI(active_grid, msgSender);
     // Initiating timer
     timer = new TimeKeeper(active_grid);
     Content.RootDirectory = "Content";
 }
Esempio n. 2
0
 // For testing purposes only
 public Game1(bool test)
 {
     graphics = new GraphicsDeviceManager(this);
     // The game terrain
     active_grid = new MainGrid();
     // Receive messages from server and update the grid
     msghandler = new MessageHandler(active_grid);
     // Send messages to the server and play the game
     msgSender = new MessageSender(msghandler);
     Content.RootDirectory = "Content";
     MessageParser p1;
     MessageParser p2;
     MessageParser p3;
     MessageParser p4;
     MessageParser p5;
     MessageParser p6;
     MessageParser p7;
     p1 = new GlobalBroadCastHandler(active_grid);
     p2 = new AquirablesHandler(active_grid);
     p3 = new MovingAndShootingHandler(active_grid);
     p4 = new GameInidiationHandler(active_grid);
     p5 = new JoinMessageParser(active_grid);
     p6 = new JoinSuccessHandler(active_grid);
     p7 = new Finalizer(active_grid);
     p1.setNext(p2);
     p2.setNext(p3);
     p3.setNext(p4);
     p4.setNext(p5);
     p5.setNext(p6);
     p6.setNext(p7);
     timer = new TimeKeeper(active_grid);
     p1.handleMessage("I:P2:5,3;1,4;3,6;0,8;2,6;4,8;6,3;5,7;1,3:2,4;6,7;7,2;8,6;2,7;1,8;7,4;8,1;0,3;7,1:4,3;6,8;9,3;0,2;1,7;2,3;5,8;9,8;5,2;7,6#");
     p1.handleMessage("S:P0;0,0;0:P1;0,9;0:P2;9,0;0#");
     p1.handleMessage("C:1,0:5000:1747#");
     //p1.handleMessage("C:3,8:10000:1747#");
     p1.handleMessage("C:8,8:15000:1747#");
     p1.handleMessage("C:6,2:15000:1747#");
     p1.handleMessage("L:5,5:5000#");
     //p1.handleMessage("L:5,6:5000#");
     gameAI = new GameAI(active_grid, msgSender);
 }