public ConnectionHandler(Parser parser) { connection = new Connection(parser); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); //screen resolution adjustment graphics.PreferredBackBufferHeight = screenHeight; graphics.PreferredBackBufferWidth = screenWidth; graphics.ApplyChanges(); IsMouseVisible = true; worldMap = new Map(10); messageParser = new Parser(worldMap); connection_handler = new ConnectionHandler(messageParser); backGroundSong = Content.Load<Song>("back_ground_music"); MediaPlayer.Play(backGroundSong); font = Content.Load<SpriteFont>("myFont"); btnNormalMode = new ButtonClass(Content.Load<Texture2D>("normal_mode"), graphics.GraphicsDevice); btnNormalMode.setPosition(new Vector2(600, 50)); btnAIMode = new ButtonClass(Content.Load<Texture2D>("ai_mode"), graphics.GraphicsDevice); btnAIMode.setPosition(new Vector2(600, 110)); btnOption = new ButtonClass(Content.Load<Texture2D>("options"), graphics.GraphicsDevice); btnOption.setPosition(new Vector2(600, 175)); btnExit = new ButtonClass(Content.Load<Texture2D>("exit"), graphics.GraphicsDevice); btnExit.setPosition(new Vector2(600, 235)); btnMainMenu = new ButtonClass(Content.Load<Texture2D>("button_mm"), graphics.GraphicsDevice); btnMainMenu.setPosition(new Vector2(650, 535)); btnSoundOn = new ButtonClass(Content.Load<Texture2D>("sound_on"), graphics.GraphicsDevice); btnSoundOn.setPosition(new Vector2(200, 235)); btnSoundOff = new ButtonClass(Content.Load<Texture2D>("sound_off"), graphics.GraphicsDevice); btnSoundOff.setPosition(new Vector2(500, 235)); btnBack = new ButtonClass(Content.Load<Texture2D>("back"), graphics.GraphicsDevice); btnBack.setPosition(new Vector2(350, 335)); }
private NetworkStream writeStream; //Stream - incoming #endregion Fields #region Constructors public Connection(Parser parser) { this.parser = parser; }