• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemoBytom / DemoEngine / 13822325961

12 Mar 2025 09:58PM UTC coverage: 9.454% (-0.2%) from 9.651%
13822325961

push

coveralls.net

DemoBytom
Moving all StaThread functionality to a separate vertical slice

227 of 2401 relevant lines covered (9.45%)

15799.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Demo.Engine.Core/RegistrationExtensions.cs
1
// Copyright © Michał Dembski and contributors.
2
// Distributed under MIT license. See LICENSE file in the root for more information.
3

4
using System.Threading.Channels;
5
using Demo.Engine.Core.Components.Keyboard.Internal;
6
using Demo.Engine.Core.Features.StaThread;
7
using Demo.Engine.Core.Interfaces;
8
using Demo.Engine.Core.Interfaces.Components;
9
using Demo.Engine.Core.Interfaces.Platform;
10
using Demo.Engine.Core.Platform;
11
using Demo.Engine.Core.Services;
12
using Microsoft.Extensions.DependencyInjection;
13

14
namespace Demo.Engine.Core;
15

16
public static class RegistrationExtensions
17
{
18
    public static IServiceCollection AddEngineCore(
19
        this IServiceCollection services) => services
×
20
                .AddScoped<IMainLoopService, MainLoopService>()
×
21
                .AddSingleton<IKeyboardCache, KeyboardCache>()
×
22
                .AddTransient<IFpsTimer, FpsTimer>()
×
23
                .AddTransient<IContentFileProvider, ContentFileProvider>()
×
24
                .AddHostedService<EngineServiceNew>()
×
25
                .AddScoped<IMainLoopLifetime, MainLoopLifetime>()
×
26
                .AddScoped<ILoopJob, LoopJob>()
×
27
                .AddScoped<IMainLoopServiceNew, MainLoopServiceNew>()
×
28
                .AddStaThreadFeature()
×
29
                ;
30

31
    internal static IServiceCollection AddScopedBoundedChannel<T>(
32
        this IServiceCollection services,
33
            BoundedChannelOptions options)
34
        => services
×
35
            .AddScoped(_
×
36
                => Channel.CreateBounded<T>(
×
37
                    options))
×
38
            .AddScoped(sp
×
39
                => sp.GetRequiredService<Channel<T>>().Reader)
×
40
            .AddScoped(sp
×
41
                => sp.GetRequiredService<Channel<T>>().Writer)
×
42
        ;
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc