示例#1
0
        public ScoreHUD(PlayerManager playerManager)
        {
            this.playerManager = playerManager;

            myScore = new Score();
            players = new List<Player>(ProtocolInformation.DummySlot);
        }
示例#2
0
        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();
        }
示例#3
0
        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;
        }
示例#4
0
文件: World.cs 项目: aotis/AngryTanks
        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);
        }
示例#5
0
文件: World.cs 项目: aotis/AngryTanks
        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);
        }