public void StartUp()
 {
     _globalServiceContainer = new ServiceContainer();
     _startUp = new Startup();
     _globalServiceContainer.EnableAnnotatedConstructorInjection();
     _startUp.RegisterServices(_globalServiceContainer);
 }
示例#2
0
        public async Task GetActorTasksTestAsync(string mode)
        {
            var serviceContainer = new ServiceCollection();
            var startUp          = new Startup();

            startUp.RegisterServices(serviceContainer);
            var serviceProvider = serviceContainer.BuildServiceProvider();

            var botSettings = new BotSettings {
                Mode = mode
            };

            var globeInitializer = serviceProvider.GetRequiredService <IGlobeInitializer>();
            var player           = serviceProvider.GetRequiredService <IPlayer>();

            var autoPlayEngine = new AutoplayEngine(
                startUp,
                botSettings,
                globeInitializer);

            var globe = await autoPlayEngine.CreateGlobeAsync().ConfigureAwait(false);

            var followedPerson = player.MainPerson;

            PrintPersonBacklog(followedPerson);

            await autoPlayEngine.StartAsync(globe, followedPerson).ConfigureAwait(false);

            PrintResult(serviceProvider);
        }
示例#3
0
        public async Task GetActorTasksTestAsync(string mode)
        {
            var serviceContainer = new ServiceCollection();
            var startUp          = new Startup();

            startUp.RegisterServices(serviceContainer);
            var serviceProvider = serviceContainer.BuildServiceProvider();

            var botSettings = new BotSettings {
                Mode = mode
            };

            var autoPlayEngine = new AutoplayEngine <HumanBotActorTaskSource>(startUp, botSettings);

            var startPerson = PersonCreateHelper.CreateStartPerson(serviceProvider);

            PrintPersonBacklog(startPerson);

            await autoPlayEngine.StartAsync(startPerson, serviceProvider).ConfigureAwait(false);

            PrintResult(serviceProvider);
        }
示例#4
0
 public void StartUp()
 {
     _globalServiceContainer = new ServiceContainer();
     _startUp = new Startup();
     _startUp.RegisterServices(_globalServiceContainer);
 }