Пример #1
0
        public override void Update(FrameEventArgs e)
        {
            base.Update(e);
            _autoTileAnimationTimer += (float)e.Time;

            if (_mapDataChanged)
            {
                if (_mapInstance != null)
                {
                    for (int i = 0; i < _mapInstance.GetMapData().MapEventsCount(); i++)
                    {
                        AddMapEvent(_mapInstance.GetMapData().GetMapEvent(i), false);
                    }

                    //
                    // add players here (when they are in the map packet)
                    //

                    for (int i = 0; i < _mapInstance.GetMapPacket().Enemies.Count; i++)
                    {
                        AddMapEnemy(_mapInstance.GetMapPacket().Enemies[i], false);
                    }

                    for (int i = 0; i < _mapInstance.GetMapPacket().Projectiles.Count; i++)
                    {
                        AddMapProjectile(_mapInstance.GetMapPacket().Projectiles[i], false);
                    }

                    for (int i = 0; i < _mapInstance.GetMapPacket().Items.Count; i++)
                    {
                        AddMapItem(_mapInstance.GetMapPacket().Items[i], false);
                    }
                }
                _mapDataChanged = false;
                GenerateMapMeshes();
            }
        }