Пример #1
0
 public void SetCallbacks(IHubActions instance)
 {
     if (m_Wrapper.m_HubActionsCallbackInterface != null)
     {
         @Movement.started   -= m_Wrapper.m_HubActionsCallbackInterface.OnMovement;
         @Movement.performed -= m_Wrapper.m_HubActionsCallbackInterface.OnMovement;
         @Movement.canceled  -= m_Wrapper.m_HubActionsCallbackInterface.OnMovement;
         @Jump.started       -= m_Wrapper.m_HubActionsCallbackInterface.OnJump;
         @Jump.performed     -= m_Wrapper.m_HubActionsCallbackInterface.OnJump;
         @Jump.canceled      -= m_Wrapper.m_HubActionsCallbackInterface.OnJump;
         @Dash.started       -= m_Wrapper.m_HubActionsCallbackInterface.OnDash;
         @Dash.performed     -= m_Wrapper.m_HubActionsCallbackInterface.OnDash;
         @Dash.canceled      -= m_Wrapper.m_HubActionsCallbackInterface.OnDash;
     }
     m_Wrapper.m_HubActionsCallbackInterface = instance;
     if (instance != null)
     {
         @Movement.started   += instance.OnMovement;
         @Movement.performed += instance.OnMovement;
         @Movement.canceled  += instance.OnMovement;
         @Jump.started       += instance.OnJump;
         @Jump.performed     += instance.OnJump;
         @Jump.canceled      += instance.OnJump;
         @Dash.started       += instance.OnDash;
         @Dash.performed     += instance.OnDash;
         @Dash.canceled      += instance.OnDash;
     }
 }
Пример #2
0
 public LogHub(
     IWorkerController workerController,
     IDataStore dataStore,
     IHubActions <LogEntry> userHubActions)
 {
     WorkerController = workerController;
     DataStore        = dataStore;
     LogHubActions    = userHubActions;
 }
Пример #3
0
 public TargetHub(
     IWorkerController workerController,
     IDataStore dataStore,
     IHubActions <Target> targetHubActions)
 {
     WorkerController = workerController;
     DataStore        = dataStore;
     TargetHubActions = targetHubActions;
 }
Пример #4
0
 public UserHub(
     IWorkerController workerController,
     IDataStore dataStore,
     IHubActions <User> userHubActions)
 {
     WorkerController = workerController;
     DataStore        = dataStore;
     UserHubActions   = userHubActions;
 }
Пример #5
0
        private async Task Add <T>(T entity, IHubActions <T> hub)
            where T : IDataObject
        {
            var store = DataStore.Get <T>();

            await store.Add(entity);

            await hub.Add(entity);
        }
Пример #6
0
        public WebController(
            IDataStore dataStore,
            IWorkerSettings workerSettings,
            IHubActions <Target> targetHubActions,
            IHubActions <User> userHubActions,
            IHubActions <LogEntry> logHubActions)
        {
            DataStore        = dataStore;
            TargetHubActions = targetHubActions;
            UserHubActions   = userHubActions;
            LogHubActions    = logHubActions;

            WorkerSettings = workerSettings;

            Tools = new Dictionary <Type, IActionModule>();
        }