Ejemplo n.º 1
0
        /// <summary>
        /// Engines root contextualize your engines and entities. You don't need to limit yourself to one EngineRoot
        /// as multiple engines root could promote separation of scopes. The EntitySubmissionScheduler checks
        /// periodically if new entity must be submitted to the database and the engines. It's an external
        /// dependencies to be independent by the running platform as the user can define it.
        /// The EntitySubmissionScheduler cannot hold an EnginesRoot reference, that's why
        /// it must receive a weak reference of the EnginesRoot callback.
        /// </summary>
        public EnginesRoot(IEntitySubmissionScheduler entityViewScheduler)
        {
            _entitiesOperations          = new FasterList <EntitySubmitOperation>();
            _entityEngines               = new Dictionary <Type, FasterList <IHandleEntityViewEngineAbstracted> >();
            _otherEngines                = new FasterList <IEngine>();
            _disposableEngines           = new FasterList <IDisposable>();
            _transientEntitiesOperations = new FasterList <EntitySubmitOperation>();

            _groupEntityDB      = new FasterDictionary <int, Dictionary <Type, ITypeSafeDictionary> >();
            _groupsPerEntity    = new Dictionary <Type, FasterDictionary <int, ITypeSafeDictionary> >();
            _groupedEntityToAdd = new DoubleBufferedEntitiesToAdd <FasterDictionary <int, Dictionary <Type, ITypeSafeDictionary> > >();

            _DB = new EntitiesDB(_groupEntityDB, _groupsPerEntity);

            _scheduler        = entityViewScheduler;
            _scheduler.onTick = new WeakAction(SubmitEntityViews);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Engines root contextualize your engines and entities. You don't need to limit yourself to one EngineRoot
        /// as multiple engines root could promote separation of scopes. The EntitySubmissionScheduler checks
        /// periodically if new entity must be submitted to the database and the engines. It's an external
        /// dependencies to be independent by the running platform as the user can define it.
        /// The EntitySubmissionScheduler cannot hold an EnginesRoot reference, that's why
        /// it must receive a weak reference of the EnginesRoot callback.
        /// </summary>
        public EnginesRoot(IEntitySubmissionScheduler entityViewScheduler)
        {
            _entitiesOperations       = new FasterDictionary <ulong, EntitySubmitOperation>();
            _reactiveEnginesAddRemove = new Dictionary <Type, FasterList <IEngine> >();
            _reactiveEnginesSwap      = new Dictionary <Type, FasterList <IEngine> >();
            _enginesSet                  = new HashSet <IEngine>();
            _disposableEngines           = new FasterList <IDisposable>();
            _transientEntitiesOperations = new FasterList <EntitySubmitOperation>();

            _groupEntityDB      = new FasterDictionary <uint, Dictionary <Type, ITypeSafeDictionary> >();
            _groupsPerEntity    = new Dictionary <Type, FasterDictionary <uint, ITypeSafeDictionary> >();
            _groupedEntityToAdd = new DoubleBufferedEntitiesToAdd();

            _entitiesStream = new EntitiesStream();
            _entitiesDB     = new EntitiesDB(_groupEntityDB, _groupsPerEntity, _entitiesStream);

            _scheduler        = entityViewScheduler;
            _scheduler.onTick = new WeakAction(SubmitEntityViews);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Engines root contextualize your engines and entities. You don't need to limit yourself to one EngineRoot
        /// as multiple engines root could promote separation of scopes. The EntitySubmissionScheduler checks
        /// periodically if new entity must be submitted to the database and the engines. It's an external
        /// dependencies to be independent by the running platform as the user can define it.
        /// The EntitySubmissionScheduler cannot hold an EnginesRoot reference, that's why
        /// it must receive a weak reference of the EnginesRoot callback.
        /// </summary>
        public EnginesRoot(IEntitySubmissionScheduler entityViewScheduler)
        {
#if DEBUG && !PROFILER
            _entitiesOperationsDebug = new FasterDictionary <long, EntitySubmitOperationType>();
#endif
            _entitiesOperations          = new FasterList <EntitySubmitOperation>();
            _entityEngines               = new Dictionary <Type, FasterList <IHandleEntityViewEngineAbstracted> >();
            _enginesSet                  = new HashSet <IEngine>();
            _disposableEngines           = new FasterList <IDisposable>();
            _transientEntitiesOperations = new FasterList <EntitySubmitOperation>();

            _groupEntityDB      = new FasterDictionary <int, Dictionary <Type, ITypeSafeDictionary> >();
            _groupsPerEntity    = new Dictionary <Type, FasterDictionary <int, ITypeSafeDictionary> >();
            _groupedEntityToAdd = new DoubleBufferedEntitiesToAdd <FasterDictionary <int, Dictionary <Type, ITypeSafeDictionary> > >();

            _entitiesDB     = new EntitiesDB(_groupEntityDB, _groupsPerEntity);
            _entitiesStream = new EntitiesStream(_entitiesDB);

            _scheduler        = entityViewScheduler;
            _scheduler.onTick = new WeakAction(SubmitEntityViews);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Engines root contextualize your engines and entities. You don't need to limit yourself to one EngineRoot
        /// as multiple engines root could promote separation of scopes. The EntitySubmissionScheduler checks
        /// periodically if new entity must be submitted to the database and the engines. It's an external
        /// dependencies to be independent by the running platform as the user can define it.
        /// The EntitySubmissionScheduler cannot hold an EnginesRoot reference, that's why
        /// it must receive a weak reference of the EnginesRoot callback.
        /// </summary>
        public EnginesRoot(IEntitySubmissionScheduler entityViewScheduler)
        {
            _entitiesOperations        = new FasterDictionary <ulong, EntitySubmitOperation>();
            serializationDescriptorMap = new SerializationDescriptorMap();
            _reactiveEnginesAddRemove  = new FasterDictionary <RefWrapper <Type>, FasterList <IEngine> >();
            _reactiveEnginesSwap       = new FasterDictionary <RefWrapper <Type>, FasterList <IEngine> >();
            _enginesSet                  = new FasterList <IEngine>();
            _enginesTypeSet              = new HashSet <Type>();
            _disposableEngines           = new FasterList <IDisposable>();
            _transientEntitiesOperations = new FasterList <EntitySubmitOperation>();

            _groupEntityViewsDB = new FasterDictionary <uint, FasterDictionary <RefWrapper <Type>, ITypeSafeDictionary> >();
            _groupsPerEntity    = new FasterDictionary <RefWrapper <Type>, FasterDictionary <uint, ITypeSafeDictionary> >();
            _groupedEntityToAdd = new DoubleBufferedEntitiesToAdd();

            _entitiesStream = new EntitiesStream();
            _entitiesDB     = new EntitiesDB(_groupEntityViewsDB, _groupsPerEntity, _entitiesStream);

            _scheduler        = entityViewScheduler;
            _scheduler.onTick = new EntitiesSubmitter(this);
        }
 public EnginesRoot(IEntitySubmissionScheduler entityViewScheduler, bool isDeserializationOnly) : this(entityViewScheduler)
 {
     _isDeserializationOnly = isDeserializationOnly;
 }
 public EnginesRootNamed(IEntitySubmissionScheduler entityViewScheduler, string name) : base(entityViewScheduler)
 {
     Name = name;
 }