Beispiel #1
0
    private void InitPlayerActor(IEnumerable <MapNodeVM> nodeViewModels)
    {
        var personScheme = _schemeService.GetScheme <PersonScheme>("captain");

        var playerActorStartNode = _sector.Map.Nodes.First();//sectorGenerator.StartNodes.First();
        var playerActorVm        = CreateHumanActorVm(_humanPlayer,
                                                      personScheme,
                                                      _actorManager,
                                                      playerActorStartNode,
                                                      nodeViewModels);

        //Лучше централизовать переключение текущего актёра только в playerState
        _playerState.ActiveActor = playerActorVm;
        _humanActorTaskSource.SwitchActor(_playerState.ActiveActor.Actor);
    }
Beispiel #2
0
    private void InitPlayerActor(IEnumerable <MapNodeVM> nodeViewModels)
    {
        var personScheme = _schemeService.GetScheme <IPersonScheme>("human-person");

        var playerActorStartNode = _sectorManager.CurrentSector.Map.Regions
                                   .Single(x => x.IsStart).Nodes
                                   .First();

        var playerActorViewModel = CreateHumanActorViewModel(_humanPlayer,
                                                             _actorManager,
                                                             _perkResolver,
                                                             playerActorStartNode,
                                                             nodeViewModels);

        //Лучше централизовать переключение текущего актёра только в playerState
        _playerState.ActiveActor = playerActorViewModel;
        _humanActorTaskSource.SwitchActor(_playerState.ActiveActor.Actor);

        ActorViewModels.Add(playerActorViewModel);
    }