protected override void ApplicationStarted() { _componentTypeLookup = Container.Resolve <IComponentTypeLookup>(); _componentDatabase = Container.Resolve <IComponentDatabase>(); _batchBuilderFactory = Container.Resolve <IBatchBuilderFactory>(); _referenceBatchBuilderFactory = Container.Resolve <IReferenceBatchBuilderFactory>(); _collection = EntityCollectionManager.GetCollection(); ClassComponent1TypeId = _componentTypeLookup.GetComponentType(typeof(ClassComponent)); ClassComponent2TypeId = _componentTypeLookup.GetComponentType(typeof(ClassComponent2)); StructComponent1TypeId = _componentTypeLookup.GetComponentType(typeof(StructComponent)); StructComponent2TypeId = _componentTypeLookup.GetComponentType(typeof(StructComponent2)); var name = GetType().Name; Console.WriteLine($"{name} - {Description}"); var timer = Stopwatch.StartNew(); SetupEntities(); timer.Stop(); Console.WriteLine($"{name} - Setting up {EntityCount} entities in {timer.ElapsedMilliseconds}ms"); timer.Reset(); timer.Start(); for (var update = 0; update < SimulatedUpdates; update++) { RunProcess(); } timer.Stop(); var totalProcessTime = TimeSpan.FromMilliseconds(timer.ElapsedMilliseconds); Console.WriteLine($"{name} - Simulating {SimulatedUpdates} updates - Processing {EntityCount} entities in {totalProcessTime.TotalMilliseconds}ms"); Console.WriteLine(); }
protected ManualBatchedSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IThreadHandler threadHandler, IObservableGroupManager observableGroupManager) { ComponentDatabase = componentDatabase; ComponentTypeLookup = componentTypeLookup; ThreadHandler = threadHandler; ObservableGroupManager = observableGroupManager; }
public BatchManager(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IBatchBuilderFactory batchBuilderFactory, IReferenceBatchBuilderFactory referenceBatchBuilderFactory, IObservableGroupManager observableGroupManager) { ComponentDatabase = componentDatabase; ComponentTypeLookup = componentTypeLookup; BatchBuilderFactory = batchBuilderFactory; ObservableGroupManager = observableGroupManager; ReferenceBatchBuilderFactory = referenceBatchBuilderFactory; }
protected BatchAccessor(IObservableGroup observableGroup, IComponentDatabase componentDatabase, IBatchBuilder batchBuilder, IComponentTypeLookup componentTypeLookup) { ObservableGroup = observableGroup; ComponentDatabase = componentDatabase; BatchBuilder = batchBuilder; ComponentTypeLookup = componentTypeLookup; SetupAccessor(); }
public Entity(int id, IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup) { Id = id; ComponentDatabase = componentDatabase; ComponentTypeLookup = componentTypeLookup; var totalComponentCount = componentTypeLookup.AllComponentTypeIds.Length; InternalComponentAllocations = new int[totalComponentCount]; _onComponentsAdded = new Subject <int[]>(); _onComponentsRemoving = new Subject <int[]>(); _onComponentsRemoved = new Subject <int[]>(); EmptyAllAllocations(); }
protected BatchedSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler) : base(componentDatabase, componentTypeLookup, threadHandler) { _batchBuilder = batchBuilderFactory.Create <T1, T2>(); }
public ExampleBatchedSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IReferenceBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler, IObservableGroupManager observableGroupManager) : base(componentDatabase, componentTypeLookup, batchBuilderFactory, threadHandler, observableGroupManager) { }
public ExampleBatchedGroupSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IReferenceBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler) : base(componentDatabase, componentTypeLookup, batchBuilderFactory, threadHandler) { }
public BatchedMovementSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler) : base(componentDatabase, componentTypeLookup, batchBuilderFactory, threadHandler) { }
public DefaultEntityFactory(IIdPool idPool, IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup) { IdPool = idPool; ComponentDatabase = componentDatabase; ComponentTypeLookup = componentTypeLookup; }
protected ReferenceBatchedSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IReferenceBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler, IObservableGroupManager observableGroupManager) : base(componentDatabase, componentTypeLookup, threadHandler, observableGroupManager) { _batchBuilder = batchBuilderFactory.Create <T1, T2>(); }
protected ManualBatchedSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IThreadHandler threadHandler) { ComponentDatabase = componentDatabase; ComponentTypeLookup = componentTypeLookup; ThreadHandler = threadHandler; }
public BatchBuilderFactory(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup) { ComponentDatabase = componentDatabase; ComponentTypeLookup = componentTypeLookup; }
public ComponentRepository(IComponentTypeLookup componentLookup, IComponentDatabase database, int defaultExpansionSize = 100) { ComponentLookup = componentLookup; DefaultExpansionSize = defaultExpansionSize; Database = database; }
public static IComponent Get(this IComponentDatabase componentDatabase, int allocationIndex, int componentTypeId) { return(componentDatabase.Get <IComponent>(componentTypeId, allocationIndex)); }
public ReferenceBatchAccessor(IObservableGroup observableGroup, IComponentDatabase componentDatabase, IBatchBuilder batchBuilder, IComponentTypeLookup componentTypeLookup) : base(observableGroup, componentDatabase, batchBuilder, componentTypeLookup) { }
public BatchBuilder(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup) { ComponentDatabase = componentDatabase; _componentTypeId1 = componentTypeLookup.GetComponentType(typeof(T1)); _componentTypeId2 = componentTypeLookup.GetComponentType(typeof(T2)); }
public BatchedMovementSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler, IObservableGroupManager observableGroupManager) : base(componentDatabase, componentTypeLookup, batchBuilderFactory, threadHandler, observableGroupManager) { }