using ComponentFramework.Modules;
using ComponentFramework;
using System;

namespace OctreeRendering
{
    class WorldState : Service, IWorldState
    {
        public event Action WorldRebuilt = ActionHelper.NullAction;

        public WorldState(ICore core) : base(core) 
        {
            Octree = new Octree<TileInfo>();
        }

        public Octree<TileInfo> Octree { get; set; }

        public int TotalInstances { get; set; }

        public void OnWorldRebuilt()
        {
            WorldRebuilt();
        }
    }

    interface IWorldState : IService
    {
        event Action WorldRebuilt;
        void OnWorldRebuilt();

        int TotalInstances { get; set; }

        Octree<TileInfo> Octree { get; set; }
    }
}
