示例#1
0
        internal Radar(Scene3D scene, AssetStore assetStore, MapCache mapCache)
        {
            _scene = scene;

            if (mapCache != null)
            {
                var mapPath  = FileSystem.NormalizeFilePath(mapCache.Name);
                var basePath = Path.GetDirectoryName(mapPath) + "/" + Path.GetFileNameWithoutExtension(mapPath);

                // Minimap images drawn by an artist
                var mapArtPath = basePath + "_art.tga";
                _miniMapTexture = assetStore.GuiTextures.GetByName(mapArtPath)?.Texture;

                if (_miniMapTexture == null)
                {
                    // Fallback to minimap images generated by WorldBuilder
                    mapArtPath      = basePath + ".tga";
                    _miniMapTexture = assetStore.GuiTextures.GetByName(mapArtPath)?.Texture;
                }
            }

            _visibleItems = new RadarItemCollection();
            _hiddenItems  = new RadarItemCollection();

            _radarEvents = new List <RadarEvent>();

            // TODO: Bridges
            // TODO: Fog of war / shroud
        }
示例#2
0
 public GameContext(
     AssetLoadContext assetLoadContext,
     AudioSystem audioSystem,
     ParticleSystemManager particleSystems,
     ObjectCreationListManager objectCreationLists,
     Terrain.Terrain terrain,
     Navigation.Navigation navigation,
     Radar radar,
     Scene3D scene)
 {
     AssetLoadContext    = assetLoadContext;
     AudioSystem         = audioSystem;
     ParticleSystems     = particleSystems;
     ObjectCreationLists = objectCreationLists;
     Terrain             = terrain;
     Navigation          = navigation;
     Radar   = radar;
     Scene3D = scene;
 }