public ProtocolAction(Dictionary <ClientView, IView> views, Client client, ClientDataPackageProvider clientDataPackageProvider, GameOutput game) { _clientDataPackageProvider = clientDataPackageProvider; _clientDataProvider = new ClientDataProvider(); _client = client; _views = views; _game = game; #region ahhhhhhhhhhhhhhhh2 _serverTableView = views[ClientView.ServerTable] as IUpdateOutputView; _commandListOutputView = views[ClientView.CommandList] as IUpdateOutputView; _boardOutputView = views[ClientView.Board] as IUpdateOutputView; _errorView = views[ClientView.Error] as IErrorView; _gameInfoOutputView = views[ClientView.GameInfo] as IUpdateOutputView; _turnInfoOutputView = views[ClientView.TurnInfo] as IUpdateOutputView; _afterTurnOutputView = views[ClientView.AfterTurnOutput] as IUpdateOutputView; _mainMenuOutputView = views[ClientView.MenuOutput] as IUpdateOutputView; _lobbyInfoDisplayView = views[ClientView.LobbyInfoDisplay] as IUpdateOutputView; _infoOutputView = views[ClientView.InfoOutput] as IUpdateOutputView; _finishInfoView = views[ClientView.FinishInfo] as IUpdateOutputView; _finishSkull1View = views[ClientView.FinishSkull1] as IUpdateOutputView; _finishSkull3View = views[ClientView.FinishSkull3] as IUpdateOutputView; _finishSkull2View = views[ClientView.FinishSkull2] as IUpdateOutputView; _enterToRefreshView = views[ClientView.EnterToRefresh] as IUpdateOutputView; #endregion _protocolActions = new Dictionary <ProtocolActionEnum, Action <DataPackage, ICommunication> > { }; _outputWrapper = new OutputWrapper(); }
public void SetViews(Dictionary <ClientView, IView> _views) { _afterTurnOutputView = _afterTurnOutputView = _views[ClientView.AfterTurnOutput] as IUpdateOutputView; _boardOutputView = _views[ClientView.Board] as IUpdateOutputView; _gameInfoOutputView = _views[ClientView.GameInfo] as IUpdateOutputView; _turnInfoOutputView = _turnInfoOutputView = _views[ClientView.TurnInfo] as IUpdateOutputView; _finishOutputView = _views[ClientView.FinishInfo] as IUpdateOutputView; _finishskull1 = _views[ClientView.FinishSkull1] as IUpdateOutputView; _finishskull2 = _views[ClientView.FinishSkull3] as IUpdateOutputView; _finishskull3 = _views[ClientView.FinishSkull2] as IUpdateOutputView; }
public InputAction(ProtocolAction protocolAction, Dictionary <ClientView, IView> views, Client client, ClientDataPackageProvider clientDataPackageProvider) { _clientDataPackageProvider = clientDataPackageProvider; _client = client; _actionHandler = protocolAction; _views = views; _errorView = views[ClientView.Error] as IErrorView; // Potential null exception error. _commandListOutputView = views[ClientView.CommandList] as IUpdateOutputView; //Potenzieller Null Ausnahmen Fehler _inputView = views[ClientView.Input] as IInputView; _serverTableView = views[ClientView.ServerTable] as IUpdateOutputView; _infoOutputView = views[ClientView.InfoOutput] as IUpdateOutputView; _mainMenuOutputView = views[ClientView.MenuOutput] as IUpdateOutputView; _outputWrapper = new OutputWrapper(); _inputActions = new Dictionary <string, Action <string, ICommunication> > { }; _udpListener = new UdpClientUnit(); }