Exemplo n.º 1
0
        private void CreateGrid()
        {
            Created     = DateTime.UtcNow;
            LastUpdated = DateTime.MinValue;
            var worldId = ZetaDia.Globals.WorldId;

            s_logger.Debug($"[{nameof(CreateGrid)}] Creating grid [{GridBounds},{GridBounds}] ZetaWorldId={worldId} AdvDiaWorldId={AdvDia.CurrentWorldDynamicId}");

            InnerGrid      = new SplitArray <T>(GridBounds, GridBounds);
            WorldDynamicId = AdvDia.CurrentWorldDynamicId;

            var currentScenes = Core.Scenes.CurrentWorldScenes;

            if (currentScenes.Any(c => c.DynamicWorldId == worldId))
            {
                s_logger.Debug($"[{nameof(CreateGrid)}] Importing Current World Data from SceneStorage.");
                Update(Core.Scenes.CreateSceneData(currentScenes, worldId));
            }

            GridStore.Grids.Add(new WeakReference <IGrid>(this));
        }
Exemplo n.º 2
0
        private void CreateGrid()
        {
            Created     = DateTime.UtcNow;
            LastUpdated = DateTime.MinValue;
            var worldId = ZetaDia.Globals.WorldId;

            Core.Logger.Debug("[{0}] Creating grid [{1},{1}] ZetaWorldId={2} AdvDiaWorldId={3}", GetType().Name, GridBounds, worldId, AdvDia.CurrentWorldDynamicId);

            InnerGrid      = new SplitArray <T>(GridBounds, GridBounds);
            WorldDynamicId = AdvDia.CurrentWorldDynamicId;

            var currentScenes = Core.Scenes.CurrentWorldScenes;

            if (currentScenes.Any() && currentScenes.First().DynamicWorldId == worldId)
            {
                Core.Logger.Debug("[{0}] Importing Current World Data from SceneStorage", GetType().Name);
                Update(Core.Scenes.CreateSceneData(currentScenes, currentScenes.First().DynamicWorldId));
            }

            GridStore.Grids.Add(new WeakReference <IGrid>(this));
        }