Esempio n. 1
0
        public void Init()
        {
            currentStateController = App.Current.StateController;
            SetupClass.SetUp();
            limitationPlayers = new CountLicenseLimitation {
                Enabled = true, Maximum = 10, RegisterName = "RAPlayers"
            };
            limitationPlayers2 = new CountLicenseLimitation {
                Enabled = true, Maximum = 20, RegisterName = "RAPlayers"
            };
            limitationTeams = new CountLicenseLimitation {
                Enabled = true, Maximum = 5, RegisterName = "Teams"
            };
            limitationFeature = new FeatureLicenseLimitation {
                Enabled = true, RegisterName = "Feature 1"
            };
            limitationFeature2 = new FeatureLicenseLimitation {
                Enabled = true, RegisterName = "Feature 1"
            };
            limitationFeatureDisabled = new FeatureLicenseLimitation {
                Enabled = false, RegisterName = "Feature 2"
            };

            mockLicenseManager         = new Mock <ILicenseManager> ();
            mockLicenseStatus          = new Mock <ILicenseStatus> ();
            App.Current.LicenseManager = mockLicenseManager.Object;
            mockLicenseManager.SetupGet(obj => obj.LicenseStatus).Returns(mockLicenseStatus.Object);

            mockStateController = new Mock <IStateController> ();
            mockScreenState     = new Mock <IScreenState> ();
            mockStateController.SetupGet(sc => sc.Current).Returns(mockScreenState.Object);
            App.Current.StateController = mockStateController.Object;
        }
Esempio n. 2
0
 public PlayerTurnState(IStateController controller, ISelectActions actionSelector,
                        ISubject playerTurnEnder, ISetInteractable[] playerButtons) : base(controller)
 {
     this.actionSelector  = actionSelector;
     this.playerTurnEnder = playerTurnEnder;
     this.playerButtons   = playerButtons;
 }
 public UcLoadDailyMeasures(IServiceFactory serviceFactory, IStateController stateController)
 {
     _stateController = stateController;
     _serviceFactory = serviceFactory;
     InitializeComponent();
     gvDailyMeasures.TableElement.RowHeight = Avicola.Common.Win.GlobalConstants.DefaultRowHeight;
 }
 public UcLoadDailyMeasures(IServiceFactory serviceFactory, IStateController stateController)
 {
     _stateController = stateController;
     _serviceFactory  = serviceFactory;
     InitializeComponent();
     gvDailyMeasures.TableElement.RowHeight = Avicola.Common.Win.GlobalConstants.DefaultRowHeight;
 }
Esempio n. 5
0
        private HubConnectionWrapper(HubConnection wrapped)
        {
            _wrapped = wrapped;
            _wrapped.DeadlockErrorTimeout = TimeSpan.FromSeconds(30);
            _wrapped.StateChanged        += change =>
            {
                switch (change.NewState)
                {
                case ConnectionState.Connected:
                    _connectNotify.Set();
                    break;

                case ConnectionState.Connecting:
                case ConnectionState.Reconnecting:
                case ConnectionState.Disconnected:
                    _connectNotify.Reset();
                    break;

                default:
                    throw new Exception("unknown ConnectionState");
                }
            };

            _stateController = new StateController(this);
        }
Esempio n. 6
0
 public static void Register(GameState s, IStateController sc, bool shouldReserve)
 {
     if (_states == null)
     {
         _states = new Dictionary <GameState, IStateController> (16);
     }
     _states.Add(s, sc);
 }
 public FrmCreateEditBatchMedicine(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory      = formFactory;
     _serviceFactory  = serviceFactory;
     _stateController = stateController;
     _batchMedicineId = id;
     InitializeComponent();
 }
 public FrmCreateEditSiloEmptying(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory = formFactory;
     _serviceFactory = serviceFactory;
     _stateController = stateController;
     _emptyingId = id;
     InitializeComponent();
 }
Esempio n. 9
0
 public FrmCreateEditBatchObservation(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory      = formFactory;
     _serviceFactory  = serviceFactory;
     _stateController = stateController;
     _observationId   = id;
     InitializeComponent();
 }
Esempio n. 10
0
 public FrmCreateEditSiloEmptying(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory      = formFactory;
     _serviceFactory  = serviceFactory;
     _stateController = stateController;
     _emptyingId      = id;
     InitializeComponent();
 }
Esempio n. 11
0
 internal void DisconnectTransisions(IStateController stateController)
 {
     foreach (var transition in _transitions)
     {
         transition.ExitStateEvent  -= stateController.ExitState;
         transition.EnterStateEvent -= stateController.EnterState;
     }
 }
 public FrmCreateEditBatchVaccine(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory = formFactory;
     _serviceFactory = serviceFactory;
     _stateController = stateController;
     _batchVaccineId = id;
     InitializeComponent();
 }
 public static void MoveUnit(this IStateController stateController, UnitState unit, Coordinates coordinates)
 {
     stateController.RequestActionWithData(new MoveActionData()
     {
         destination = coordinates,
         unitId      = unit.unitId
     });
 }
Esempio n. 14
0
 public ManagedStateMachineEventArgs(
     IStateController state_controller,
     Animator animator,
     int state_machine_path_hash) :
     base(animator, state_machine_path_hash)
 {
     StateController = state_controller;
 }
Esempio n. 15
0
 public PlayerResolveTurnState(
     IStateController controller,
     ICommandProcessor playerProcessor,
     IHealth playerHealth
     ) : base(controller)
 {
     this.playerProcessor = playerProcessor;
     this.playerHealth    = playerHealth;
 }
 public EnemyResolveTurnState(
     IStateController controller,
     ICommandProcessor enemyProcessor,
     IHealth enemyHealth
     ) : base(controller)
 {
     this.enemyProcessor = enemyProcessor;
     this.enemyHealth    = enemyHealth;
 }
 public TurnResolutionState(IStateController controller, ICommandProcessor playerProcessor,
                            ICommandProcessor enemyProcessor, IResetActions playerReset,
                            IResetActions enemyReset) : base(controller)
 {
     this.playerProcessor = playerProcessor;
     this.enemyProcessor  = enemyProcessor;
     this.playerReset     = playerReset;
     this.enemyReset      = enemyReset;
 }
        public FrmStandardSelection(IFormFactory formFactory, IServiceFactory serviceFactory, IStateController stateController)
        {
            FormFactory = formFactory;

            _serviceFactory = serviceFactory;
            _stateController = stateController;

            InitializeComponent();
        }
Esempio n. 19
0
        public FrmStandardSelection(IFormFactory formFactory, IServiceFactory serviceFactory, IStateController stateController)
        {
            FormFactory = formFactory;

            _serviceFactory  = serviceFactory;
            _stateController = stateController;

            InitializeComponent();
        }
Esempio n. 20
0
 public ManagedStateEventArgs(
     IStateController state_controller,
     Animator animator,
     AnimatorStateInfo animator_state_info,
     int layer_index) :
     base(animator, animator_state_info, layer_index)
 {
     StateController = state_controller;
 }
Esempio n. 21
0
    private void Start()
    {
        // Change controller according to will
        MovementController = new NavMeshController(gameObject);

        // Change controller according to will
        SimpleAI       = new SimpleAI(transform, m_Target, MovementController);
        m_CurrentState = new IdleState(SimpleAI);
    }
Esempio n. 22
0
 public UnitSelectedStateBehaviour(HighlightingColorSettings highlightingColorSettings,
                                   IInteractionManagerDesktop <ITileView> tileSelector,
                                   IInteractionManagerDesktop <IUnitView> unitSelector,
                                   IStateController stateController)
 {
     _highlightingColorSettings = highlightingColorSettings;
     _tileSelector    = tileSelector;
     _unitSelector    = unitSelector;
     _stateController = stateController;
 }
Esempio n. 23
0
        public FrmMoveNextStage(IFormFactory formFactory, IMessageBoxDisplayService messageBoxDisplayService,
                                IStateController stateController, IServiceFactory serviceFactory)
        {
            _stateController = stateController;
            _serviceFactory  = serviceFactory;

            FormFactory = formFactory;
            MessageBoxDisplayService = messageBoxDisplayService;

            InitializeComponent();
        }
Esempio n. 24
0
        public ControllerStateManager(IStateController <TStateType> stateController,
                                      IStateMachine <TState> stateMachine,
                                      IStateFactory <TStateType, TState> stateFactory,
                                      IStateValidator <TStateType> validator = null) :
            base(stateMachine, stateFactory, validator)
        {
            _stateController = stateController;

            ObservableExtensions.Subscribe <TStateType>(_stateController.StateObservable.
                                                        Skip(1), ExecuteState).AddTo(_disposables);
        }
Esempio n. 25
0
        public FrmBatchSelection(IFormFactory formFactory, IServiceFactory serviceFactory, IStateController stateController)
        {
            FormFactory = formFactory;

            _serviceFactory  = serviceFactory;
            _stateController = stateController;

            InitializeComponent();

            gvBatches.TableElement.RowHeight = Avicola.Common.Win.GlobalConstants.DefaultRowHeight;
        }
Esempio n. 26
0
        public FrmBatchManager(IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
        {
            FormFactory = formFactory;

            _stateController = stateController;
            _serviceFactory  = serviceFactory;

            InitializeComponent();

            btnMoveNextStage.RootElement.UseDefaultDisabledPaint = true;
        }
Esempio n. 27
0
        public FrmBatchManager(IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
        {
            FormFactory = formFactory;

            _stateController = stateController;
            _serviceFactory = serviceFactory;

            InitializeComponent();

            btnMoveNextStage.RootElement.UseDefaultDisabledPaint = true;
        }
Esempio n. 28
0
        public FrmBatchSelection(IFormFactory formFactory , IServiceFactory serviceFactory,IStateController stateController)
        {
            FormFactory = formFactory;

            _serviceFactory = serviceFactory;
            _stateController = stateController;

            InitializeComponent();

            gvBatches.TableElement.RowHeight = Avicola.Common.Win.GlobalConstants.DefaultRowHeight;
        }
Esempio n. 29
0
        public FrmMoveNextStage(IFormFactory formFactory, IMessageBoxDisplayService messageBoxDisplayService,
            IStateController stateController, IServiceFactory serviceFactory)
        {
            _stateController = stateController;
            _serviceFactory = serviceFactory;

            FormFactory = formFactory;
            MessageBoxDisplayService = messageBoxDisplayService;

            InitializeComponent();
        }
Esempio n. 30
0
 public EndResolveTurnState(
     IStateController controller,
     IResetActions playerActionsReset,
     IResetActions enemyActionsReset,
     IHealth enemyHealth
     ) : base(controller)
 {
     this.playerActionsReset = playerActionsReset;
     this.enemyActionsReset  = enemyActionsReset;
     this.enemyHealth        = enemyHealth;
 }
        public FrmEnterDailyMeasures(IFormFactory formFactory,
            IServiceFactory serviceFactory,
            IStateController stateController,
            IMessageBoxDisplayService messageBoxDisplayService)
        {
            FormFactory = formFactory;

            _serviceFactory = serviceFactory;
            _stateController = stateController;
            _messageBoxDisplayService = messageBoxDisplayService;

            InitializeComponent();
        }
Esempio n. 32
0
 public AsyncStateManager(IStateController <TStateType> stateController,
                          IAsyncStateMachine stateMachine,
                          IAsyncStateFactory <TStateType> stateFactory,
                          IStateValidator <TStateType> validator = null)
 {
     _stateController      = stateController;
     _stateMachine         = stateMachine;
     _stateFactory         = stateFactory;
     _validator            = validator;
     _controllerDisposable =
         _stateController.StateObservable.
         Skip(1).Subscribe(ExecuteState);
 }
        public FrmEnterDailyMeasures(IFormFactory formFactory,
                                     IServiceFactory serviceFactory,
                                     IStateController stateController,
                                     IMessageBoxDisplayService messageBoxDisplayService)
        {
            FormFactory = formFactory;

            _serviceFactory           = serviceFactory;
            _stateController          = stateController;
            _messageBoxDisplayService = messageBoxDisplayService;

            InitializeComponent();
        }
Esempio n. 34
0
        public void LoadScene <T>(Action callback, object passedParams) where T : IStateController, new()
        {
            onNewSceneLoaded = callback;

            //Don't show transition screen if it's our first load.
            if (!isTransitionDone)
            {
                m_transitionScreen.StartFade(FadeType.FadeOut, onTransitionShown);
            }

            newScene = new T();
            newScene.Load(onSceneLoaded, passedParams);
        }
    protected void RpcSetGameState(GameState state)
    {
        Debug.Log(isServer + " changing state to " + state);
        if (stateController != null)
        {
            stateController.OnExitState();
        }
        gameState = state;
        int stateControllerIndex = (int)gameState;

        stateController = availableStates[stateControllerIndex - 1];
        stateController.OnEnterState();
    }
Esempio n. 36
0
        public App()
            : base()
        {
            window       = new MainWindow();
            stateMachine = new StateController();

            isVolatile = false;

            AssignHandlers();
            window.ResetWindow();
            ModifyPage(stateMachine.GetSystemState());

            window.Show();
        }
 public SimulationInitializeState(IStateController <SimulationState> controller,
                                  TestUnitFactory unitFactory,
                                  Player player,
                                  SimulationOnGui onGui,
                                  BaseWorld world,
                                  WorldData worldData)
 {
     _controller  = controller;
     _unitFactory = unitFactory;
     _player      = player;
     _onGui       = onGui;
     _world       = world;
     _worldData   = worldData;
 }
Esempio n. 38
0
        public void LoadScene <T>(SceneLoadedCallback callback, object passedParams) where T : IStateController, new()
        {
            onNewSceneLoaded = callback;

            //Don't show transition screen if it's our first load.
            if (!isTransitionDone)
            {
                m_transitionScreen.SetActive(true);
                m_transitionScreen.PlayTransitionOut(onTransitionShown);
            }

            newScene = new T();
            newScene.Load(onSceneLoaded, passedParams);
        }
Esempio n. 39
0
        /// <summary>
        /// Adds the specified state controller.
        /// </summary>
        /// <param name="stateController">The state controller.</param>
        /// <returns></returns>
        public short Add(IStateController stateController)
        {
            lock (_Lock)
            {
                _Controllers.Add(stateController.Guid, stateController);

                var key = _CurrentId;

                _AllocationTable.Add(stateController.Guid, key);

                _CurrentId++;
                return key;
            }
        }
        public FrmObservationList(IFormFactory formFactory, 
            IStateController stateController, 
            IServiceFactory serviceFactory,
            IMessageBoxDisplayService messageBoxDisplayService)
        {
            FormFactory = formFactory;
            _stateController = stateController;
            _serviceFactory = serviceFactory;
            _messageBoxDisplayService = messageBoxDisplayService;
            RadGridLocalizationProvider.CurrentProvider = new CustomRadGridViewLocalizationProvider();

            InitializeComponent();

            this.gvBatchObservations.CellFormatting += Grilla_CellFormatting;
        }
 public UcLoadWeeklyMeasures(IStateController stateController)
 {
     _stateController = stateController;
     InitializeComponent();
 }
Esempio n. 42
0
        /// <summary>
        /// Removes the specified state controller.
        /// </summary>
        /// <param name="stateController">The state controller.</param>
        public void Remove(IStateController stateController)
        {
            lock (_Lock)
            {
                if (_Controllers.ContainsKey(stateController.Guid))
                {
                    _Controllers.Remove(stateController.Guid);
                }

                if (_AllocationTable.ContainsKey(stateController.Guid))
                {
                    _AllocationTable.Remove(stateController.Guid);
                }
            }
        }