Пример #1
0
        public void Init(string version)
        {
            instance          = this;
            serializer        = new BinaryFormatterSerializer();
            objectPool        = new ObjectPool();
            provider          = new PhotonNetworkProvider();
            messenger         = new HoloNetMessenger();
            players           = new PlayersManager();
            objectsManager    = new NetObjectsManager();
            stateSynchronizer = new StateSynchronizer();
            tickSynchronizer  = new TickSynchronizer();
            rooms             = new RoomsManager();

            provider.Init(version);
            objectsManager.Init();
            stateSynchronizer.Init();
            tickSynchronizer.Init();

            messenger.Pause();
            tickSynchronizer.Pause();

            serializer.RegisterSerializationRule <Vector3>(new Vector3SerializationRule());
            serializer.RegisterSerializationRule <Quaternion>(new QuaternionSerializationRule());
            serializer.RegisterSerializationRule <HoloNetPlayer>(new HoloNetPlayerSerializationRule());
        }
        public CreateAccountViewModel(PageNavigator pageNavigator, SafeCommandFactory commandFactory,
                                      Func <DateTimeOffset> timeStamp, ILoggerService loggerService, IPropertiesRepository propertiesRepository,
                                      BotService botService, AccountService accountService, GuidService guidService,
                                      BlockChainConfiguration config, StateSynchronizer stateSynchronizer)
            : base(pageNavigator, commandFactory, timeStamp, loggerService, propertiesRepository, botService)
        {
            this.accountService = accountService;
            this.guidService    = guidService;
            this.config         = config;

            RemoteState = CommandFactory.Create(async() => { await stateSynchronizer.SetStartState(Identifier); });
        }
        public void TestSetup()
        {
            state1 = Substitute.For <IStreamState>();
            state2 = Substitute.For <IStreamState>();
            state3 = Substitute.For <IStreamState>();

            state1.Name.Returns("state1");
            state2.Name.Returns("state2");
            state3.Name.Returns("state3");

            statesProvider = Substitute.For <IStreamStatesProvider>();
            statesProvider.GetStates().Returns(new[] { state1, state2, state3 });

            jobFactory  = Substitute.For <IStreamJobFactory>();
            jobLauncher = Substitute.For <IJobLauncher>();

            state = new SchedulerState(Task.CompletedTask, CancellationToken.None);

            synchronizer = new StateSynchronizer(statesProvider, jobFactory, jobLauncher);
        }
Пример #4
0
 public BotController(StateSynchronizer stateSynchronizer)
 {
     this.stateSynchronizer = stateSynchronizer;
 }
Пример #5
0
 //Инициализируем главный сервис навигации
 private async void SynchronizerInit(StateSynchronizer synchronizer)
 {
     await synchronizer.Init();
 }