protected ReactiveSystemApp(Contexts contexts) : base(contexts) { GameScope = contexts.Get <GameScope>(); InputScope = contexts.Get <InputScope>(); GameStateScope = contexts.Get <GameStateScope>(); GameConfigScope = contexts.Get <GameConfigScope>(); }
public EasyAConsumer(TaskCompletionSource <ConsumeContext <EasyA> > received, ScopedContext scopedContext, TaskCompletionSource <ScopedContext> scopedContextCompletionSource) { _received = received; _scopedContext = scopedContext; _scopedContextCompletionSource = scopedContextCompletionSource; }
internal static async Task Reset() { await Context.Reset(); Context = new ScopedContext(scopeFactory); CommitmentsApi = Substitute.For <ICommitmentsApiClient>(); RoatpApi = Substitute.For <IRoatpService>(); AccountsApi = Substitute.For <IAccountApiClient>(); TimeProvider = Substitute.For <ITimeProvider>(); }
public static void RunBeforeAnyTests() { var services = CreateServices(); scopeFactory = services .BuildServiceProvider() .GetService <IServiceScopeFactory>(); Context = new ScopedContext(scopeFactory); }
public static int GetNextEmptyRow(ScopedContext <GameScope> gameScope, Vector2Int position) { position.y -= 1; while (position.y >= 0 && gameScope.GetPieceWithPosition(position) == null) { position.y -= 1; } return(position.y + 1); }
public async Task Should_use_the_same_scope_for_consume_and_send() { await InputQueueSendEndpoint.Send <EasyA>(new { InVar.CorrelationId }); await EasyASource.Task; await EasyBSource.Task; ScopedContext context = await ScopedContextSource.Task.OrCanceled(InactivityToken); await context.ConsumeContext.Task.OrCanceled(InactivityToken); await context.ConsumeContextEasyA.Task.OrCanceled(InactivityToken); await context.SendContext.Task.OrCanceled(InactivityToken); Assert.ThrowsAsync <TimeoutException>(async() => await context.ConsumeContextEasyB.Task.OrTimeout(s: 2)); }
public ScopedSendFilter(ScopedContext scopedContext) { _scopedContext = scopedContext; }
public ScopedConsumeFilter(ScopedContext scopedContext) { _scopedContext = scopedContext; }
public EasyBConsumer(TaskCompletionSource <ConsumeContext <EasyB> > received, ScopedContext scopedContext) { _received = received; _scopedContext = scopedContext; }
protected ReactiveSystemG(Contexts contexts) : base(contexts.Get <TS>()) { _contexts = contexts; Scope = contexts.Get <TS>(); }
public static Entity <TScope> GetEntityById <TScope, TComp>(this ScopedContext <TScope> context, Int32 id) where TScope : IScope where TComp : Scope <TScope> { return(context.GetEntity(nameof(Id), id)); }
public static void AddEntityIndex <TScope, TComp>(ScopedContext <TScope> context) where TScope : IScope where TComp : IComponent, Scope <TScope> { context.AddEntityIndex( nameof(Id) , context.GetGroup(Matcher <TScope, TComp> .I) , (e, c) => ((StructComponent <Id>)c).Data.Value); }
public static void Init_Manually <TScope, TIdComp> (ScopedContext <TScope> context) where TScope : IScope where TIdComp : struct, IComponent, Scope <TScope> { if (Lookup <TScope, Id> .Id < 0) { //Debug.Log( "No " + typeof(Id) +" component in " + typeof( TScope ) ); return; } context.OnEntityCreated += (context1, entity) => { // TODO: comment why Replace and not Add var componentLookupId = Lookup <TScope, Id> .Id; var component = entity.CreateComponent <StructComponent <Id> >(componentLookupId); component.Data = new Id(entity.creationIndex, context1); entity.ReplaceComponent(componentLookupId, component); }; AddEntityIndex <TScope, TIdComp>(context); }
internal MsSqlBulkCopy(ScopedContext context, DbDataReader reader, string destinationTable, SqlBulkOptions bulkOptions, params string[] fields) : base(context, reader, destinationTable, bulkOptions, fields) { }
protected override BulkCopy GetBulkCopy(ScopedContext context, DbDataReader reader, string destinationTable, BulkOptions bulkOptions, params string[] fields) { return(new MsSqlBulkCopy(context, reader, destinationTable, (SqlBulkOptions)bulkOptions, fields)); }
public InputSystem(Contexts contexts) { _context = contexts.Scope <InputScope>(); }