public ScoreHUD(PlayerManager playerManager) { this.playerManager = playerManager; myScore = new Score(); players = new List<Player>(ProtocolInformation.DummySlot); }
public override void Dispose() { playerManager.Dispose(); playerManager = null; mapObjects.Clear(); tiled.Clear(); stretched.Clear(); spriteBatch.Dispose(); content.Unload(); GraphicsDevice.DeviceReset -= GraphicsDeviceReset; ServerLink.MessageReceivedEvent -= HandleReceivedMessage; if(scoreHUD != null) scoreHUD.isActive = false; //Deactivate scoreHUD to prevent NullReferenceException base.Dispose(); }
private Vector2 lastPlayerPosition; // TODO we shouldn't store this here public World(IServiceProvider iservice, ServerLink serverLink) : base(iservice) { this.IService = iservice; this.serverLink = serverLink; this.tiled = new List<Sprite>(); this.stretched = new List<Sprite>(); // initialize variable database // TODO need to get variables from server and stick them in this structure this.varDB = new VariableDatabase(); // initialize player manager this.playerManager = new PlayerManager(this); // initialize score HUD this.scoreHUD = new ScoreHUD(this.playerManager); ServerLink.MessageReceivedEvent += HandleReceivedMessage; }
protected override void Dispose(bool disposing) { if (disposing) { playerManager.Dispose(); playerManager = null; mapObjects.Clear(); tiled.Clear(); stretched.Clear(); spriteBatch.Dispose(); content.Unload(); graphicsDevice.DeviceReset -= GraphicsDeviceReset; ServerLink.MessageReceivedEvent -= HandleReceivedMessage; } base.Dispose(disposing); }
private Vector2 lastPlayerPosition; // TODO we shouldn't store this here public World(Game game, ServerLink serverLink) : base(game) { this.serverLink = serverLink; this.tiled = new List<Sprite>(); this.stretched = new List<Sprite>(); // initialize variable database // TODO need to get variables from server and stick them in this structure this.varDB = new VariableDatabase(); // initialize player manager this.playerManager = new PlayerManager(this); }