Exemplo n.º 1
0
 //<Constructors>
 public Client(ICommunication communication)
 {
     _communication = communication;
     _ActionHanlder = new ProtocolAction();
     _InputHandler  = new InputAction(_ActionHanlder);
     _OutputWrapper = new OutputWrapper();
 }
Exemplo n.º 2
0
 //<Constructors>
 public Client(ICommunication communication)
 {
     _game = new GameOutput();
     _clientDataPackageProvider = new ClientDataPackageProvider();
     _viewDictionary            = new ViewDictionary();
     _communication             = communication;
     _actionHandler             = new ProtocolAction(_viewDictionary._views, this, _clientDataPackageProvider, _game);
     _inputHandler  = new InputAction(_actionHandler, _viewDictionary._views, this, _clientDataPackageProvider);
     _outputWrapper = new OutputWrapper();
     _viewUpdater   = new ViewUpdater(_viewDictionary._views);
     _actionHandler._enterToRefreshView.ViewEnabled = true;
     _actionHandler._enterToRefreshView.SetUpdateContent("Press enter to refresh\nafter you typed a command.");
 }
Exemplo n.º 3
0
        public InputAction(ProtocolAction protocolAction)
        {
            _ActionHanlder = protocolAction;
            _OutputWrapper = new OutputWrapper();

            _inputActions = new Dictionary <string, Action <string, ICommunication> >
            {
                { "/help", OnInputHelpAction },
                { "/rolldice", OnInputRollDiceAction },
                { "/closegame", OnCloseGameAction },
                { "/someInt", OnIntAction },
                { "/search", OnSearchAction },
                { "/startgame", OnStartGameAction }
            };

            _UdpListener = new Receiver();
        }