public CLIGameState(IInputTranslator <NetworkCommandConnection, UserDataWithLoginToken> networkCommandToFullUserDataTranslator) { if (networkCommandToFullUserDataTranslator == null) { throw new ArgumentNullException(nameof(networkCommandToFullUserDataTranslator)); } CurrentNetworkCommandToFullUserDataTranslator = networkCommandToFullUserDataTranslator; }
public void Shutdown(IInputTranslator translator) { translator.UnsubscribeFromAxisInput(horizontalAxis, GetHorizontal); translator.UnsubscribeFromAxisInput(verticalAxis, GetVertical); translator.UnsubscribeFromAxisInput(cancelAxis, GetCancel); translator.UnsubscribeFromAxisInput(fireAxis, GetFire1); translator.UnsubscribeFromAxisInput(jumpAxis, GetJump); translator.UnsubscribeFromAxisInput(saveAxis, GetSave); translator.UnsubscribeFromAxisInput(jumpAxis, GetLoad); }
public void Initialize(IInputTranslator translator) { translator.SubscribeToAxisInput(horizontalAxis, GetHorizontal); translator.SubscribeToAxisInput(verticalAxis, GetVertical); translator.SubscribeToAxisInput(cancelAxis, GetCancel); translator.SubscribeToAxisInput(fireAxis, GetFire1); translator.SubscribeToAxisInput(jumpAxis, GetJump); translator.SubscribeToAxisInput(saveAxis, GetSave); translator.SubscribeToAxisInput(loadAxis, GetLoad); }
public ServerNetworkGameStateContext( NetIncomingMessageBusService <NetServer> netIncomingMessageBusService, NetOutgoingMessageBusService <NetServer> netOutgoingMessageBusService, IInputTranslator <NetIncomingMessage, NetworkCommandConnection> networkCommandServerTranslator, IGameStateService <byte, TWorld> gameStateService, ILogger <byte> logger) { CurrentNetIncomingMessageBusService = netIncomingMessageBusService ?? throw new ArgumentNullException(nameof(netIncomingMessageBusService)); CurrentNetOutgoingMessageBusService = netOutgoingMessageBusService ?? throw new ArgumentNullException(nameof(netOutgoingMessageBusService)); CurrentNetworkCommandServerTranslator = networkCommandServerTranslator ?? throw new ArgumentNullException(nameof(networkCommandServerTranslator)); GameStateRegistrar = gameStateService ?? throw new ArgumentNullException(nameof(gameStateService)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public DefaultBusInputRecordService( IInputTranslator <Keys[], IEnumerable <string> > keyboardTranslator = null, IInputTranslator <MouseState, IEnumerable <string> > mouseTranslator = null, IList <IInputTranslator <GamePadState, IEnumerable <string> > > gamepadTranslators = null, IList <IInputTranslator <JoystickState, IEnumerable <string> > > joystickTranslators = null, IInputTranslator <ScreenService, IEnumerable <string> > screenServiceVector2Translator = null) { MouseTranslator = mouseTranslator; //(mouseTranslator ?? new GenericMouseDeviceToKeysTranslator()); KeyboardTranslator = keyboardTranslator; //(keyboardTranslator ?? new GenericKeyboardDeviceToKeysTranslator()); GamePadsTranslators = gamepadTranslators; //(gamepadTranslators ?? GetGenericGamePadTranslators()); JoystickTranslators = joystickTranslators; //((joystickTranslators ?? GetGenericJoystickTranslators()); //TODO! ScreenServiceVector2Translator = screenServiceVector2Translator; }
public NetworkCommandConnectionProducerService( NetIncomingMessageBusService <TNetPeer> netIncomingMessageBusService, IInputTranslator <NetIncomingMessage, NetworkCommandConnection> incomingMessageToNetworkCommandConnectionTranslator ) { if (incomingMessageToNetworkCommandConnectionTranslator == null) { throw new ArgumentNullException(nameof(incomingMessageToNetworkCommandConnectionTranslator)); } IncomingMessageToNetworkCommandConnectionTranslator = incomingMessageToNetworkCommandConnectionTranslator; if (netIncomingMessageBusService == null) { throw new ArgumentNullException(nameof(netIncomingMessageBusService)); } NetIncomingMessageBusService = netIncomingMessageBusService; }
void Awake() { inputTranslator = new InputTranslator(dirKeys, skillKeys); }