コード例 #1
0
    // TODO: Rewrite this whole logic so that all these dependencies are created PER PAGE when it opens, and are disposed when the page closes.
    public WorldScreenStateManager(
        ITyperPool typerPool,
        IConnectionManager connectionManager,
        WorldScreenState state,
        ILocationsClient locationsClient)
    {
        _characterId     = connectionManager.CharacterId;
        _typerPool       = typerPool;
        _locationsClient = locationsClient;

        connectionManager.WorldStateObservable.Subscribe(state =>
        {
            if (state == null)
            {
                return; // TODO: Show loading screen?
            }
            lock (_updateStateLock)
            {
                UpdateState(state);
            }
        });

        _currentState = state;
        _stateSubject = new BehaviorSubject <WorldScreenState>(_currentState);
    }
コード例 #2
0
 protected MultiTyperInputHandler(
     ITyperPool typerPool,
     ComponentPool?componentPool = null)
 {
     TyperPool      = typerPool;
     _componentPool = componentPool;
 }
コード例 #3
0
    public MainMenuState(ITyperPool typerPool)
    {
        _typerPool = typerPool;

        Exit            = _typerPool.MakeUniqueTyper("exit");
        CreateCharacter = _typerPool.MakeUniqueTyper("create-character");
    }
コード例 #4
0
    public WorldScreenState(
        ITyperPool typerPool)
    {
        _typerPool      = typerPool;
        CurrentLocation = null;

        Disconnect = _typerPool.MakeUniqueTyper("disconnect");
    }
コード例 #5
0
 public CharacterCreationState(
     ITyperPool typerPool,
     ComponentPool componentPool)
 {
     CharacterNameInput = componentPool.MakeInputComponent();
     BackToMainMenu     = typerPool.MakeUniqueTyper();
     CreateCharacter    = typerPool.MakeUniqueTyper();
 }
コード例 #6
0
    public static Typer MakeUniqueTyper(this ITyperPool typerPool)
    {
        var id    = Guid.NewGuid().ToString();
        var typer = typerPool.MakeUniqueTyper(id);

        typer.Id = id;

        return(typer);
    }
コード例 #7
0
 public MainMenuInputHandler(
     ITyperPool typerPool,
     ComponentPool componentPool,
     MainMenuState state,
     IScreenNavigation screenNavigation,
     IConnectionManager connectionManager) : base(typerPool, componentPool)
 {
     _screenNavigation  = screenNavigation;
     _connectionManager = connectionManager;
     _state             = state;
 }
コード例 #8
0
 public CharacterCreationInputHandler(
     ITyperPool typerPool,
     ComponentPool componentPool,
     CharacterCreationState state,
     IScreenNavigation screenNavigation,
     ICharactersClient charactersClient) : base(typerPool, componentPool)
 {
     _screenNavigation = screenNavigation;
     _charactersClient = charactersClient;
     _state            = state;
 }
コード例 #9
0
    public static void RemoveTyper(this ITyperPool typerPool, string id)
    {
        var typer = typerPool.GetByKey(id);

        if (typer == null)
        {
            return;
        }

        typerPool.RemoveTyper(typer);
    }
コード例 #10
0
    public DialogScreenHandler(
        ITyperPool typerPool,
        IOutput output) : base(typerPool)
    {
        _output = output;

        _text         = null !;
        _ok           = null !;
        _cancel       = null !;
        _okAction     = null !;
        _cancelAction = null !;
    }
コード例 #11
0
 public ComponentPool(ITyperPool focusTyperPool)
 {
     _focusTyperPool = focusTyperPool;
 }