Ejemplo n.º 1
0
 void Awake()
 {
     _rb             = GetComponent <Rigidbody2D>();
     playerCharacter = gameObject.GetComponent <PlayerCharacter>();
     animator        = gameObject.transform.Find("Sprite").GetComponent <Animator>();
     controllerState = ControllerStates.Idle;
 }
Ejemplo n.º 2
0
        public override void ControlState(ControllerStates state)
        {
            _controllerStates = state;
            switch (state)
            {
            case ControllerStates.Blank:
                _canSave   = true;
                _canPrint  = false;
                _canSearch = true;
                break;

            case ControllerStates.Edited:
                _canSave   = true;
                _canPrint  = false;
                _canSearch = false;
                break;

            case ControllerStates.Saved:
                _canSave   = true;
                _canPrint  = true;
                _canSearch = false;
                break;

            case ControllerStates.Loaded:
                break;
            }
        }
Ejemplo n.º 3
0
        public override void ControlState(ControllerStates state)
        {
            ControllerState = state;
            switch (state)
            {
            case ControllerStates.Blank:
                _canSave    = true;
                _canSearch  = true;
                _hasChanges = false;
                break;

            case ControllerStates.Edited:
                _hasChanges = true;
                _canSearch  = false;
                break;

            case ControllerStates.Saved:
                _canSave    = true;
                _canSearch  = false;
                _hasChanges = false;
                break;

            case ControllerStates.Loaded:
                _hasChanges = false;
                break;

            default:
                throw new ArgumentOutOfRangeException("state");
            }
        }
        /// <summary>
        /// Sets up the controller
        /// </summary>
        public void Initialize()
        {
            m_State       = ControllerStates.MAX;
            m_Interactors = new InteractorController[(int)ControllerStates.MAX];

            TeleportationThreshold = 0.3f;
        }
Ejemplo n.º 5
0
        public override void ControlState(ControllerStates state)
        {
            _controllerStates = state;
            switch (state)
            {
            case ControllerStates.Blank:
                _canSave   = true;
                _canPrint  = false;
                _canSearch = true;
                DocFollows = new ObservableCollection <DocRecordFollow>();
                RaiseFilePathChanged(string.Empty);
                break;

            case ControllerStates.Edited:
                _canSave   = true;
                _canPrint  = false;
                _canSearch = false;

                break;

            case ControllerStates.Saved:
                _canSave   = true;
                _canPrint  = true;
                _canSearch = false;
                RefreshFollows();
                break;

            case ControllerStates.Loaded:
                break;
            }
        }
Ejemplo n.º 6
0
    void OnMouseUp()
    {
        Debug.Log("MouseUp");
        _rb.isKinematic = false;

        if (playerCharacter.currentFloor != null && controllerState == ControllerStates.Dragging)
        {
            NonPlayerCharacter enemy = playerCharacter.currentFloor.transform.GetChild(3).GetComponent <NonPlayerCharacter>();
            // snap player to fighting position
            playerCharacter.transform.position = playerCharacter.currentFloor.transform.position + playerCharacter.currentFloor.transform.TransformDirection(new Vector3(6, 0));

            // snap cam to floor height
            mainCam.transform.position = new Vector3(mainCam.transform.position.x, playerCharacter.transform.position.y, mainCam.transform.position.z);

            if (enemy.healthSystem.health > 0)
            {
                StartBattle();
            }
            else
            {
                controllerState = ControllerStates.Idle;
            }
        }
        else if (playerCharacter.currentFloor == null && controllerState == ControllerStates.Dragging)
        {
            transform.position = dragOrigin;
            controllerState    = ControllerStates.Idle;
        }
    }
Ejemplo n.º 7
0
        public override void ControlState(ControllerStates state)
        {
            State = state;
            switch (State)
            {
            case ControllerStates.Blank:
                _canSave            = true;
                _canPrint           = false;
                _canSearch          = true;
                _canDelete          = false;
                _canOpenContract    = true;
                _canOpenSigner      = true;
                IsScheduleIdEnabled = true;
                RaiseContorllerChanged(ControllerAction.Cleared);
                UpdateStatistics();
                break;

            case ControllerStates.Edited:
                _canSave            = true;
                _canPrint           = true;
                _canSearch          = false;
                _canDelete          = true;
                _canOpenContract    = true;
                _canOpenSigner      = true;
                IsScheduleIdEnabled = false;
                RaiseContorllerChanged(ControllerAction.Edited);
                UpdateStatistics();
                break;

            case ControllerStates.Saved:
                _canSave            = true;
                _canPrint           = true;
                _canSearch          = false;
                _canDelete          = true;
                _canOpenContract    = true;
                _canOpenSigner      = true;
                IsScheduleIdEnabled = false;
                RaiseContorllerChanged(ControllerAction.Saved);
                DeletedDetails = new List <ScheduleDetailsController>();
                UpdateStatistics();
                break;

            case ControllerStates.Loaded:
                _canSave            = true;
                _canPrint           = true;
                _canSearch          = false;
                _canDelete          = true;
                _canOpenContract    = true;
                _canOpenSigner      = true;
                IsScheduleIdEnabled = false;
                RaisePropertyChanged("");
                //Here to subscribe to the loaded events;
                RaiseContorllerChanged(ControllerAction.Saved);
                UpdateStatistics();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 8
0
    public override void Start()
    {
        base.Start();
        controllerStates         = new ControllerStates();
        controllerStates.faceDir = 1;

        _smallMovement = new Vector2(0.0001f, 0.0001f);
    }
Ejemplo n.º 9
0
            /// <summary>
            /// True if the interactor from given <paramref name="controller"/> is either touching or grabbing an interactable.
            /// </summary>
            /// <returns></returns>
            public bool IsControllerInteracting(ControllerStates controller)
            {
                if (controller == ControllerStates.Max)
                {
                    return(false);
                }

                return(interactors[(int)controller].IsInteractorInteracting());
            }
Ejemplo n.º 10
0
            /// <summary>
            /// Attaches a game object that represents an interactor for a state, to a state.
            /// </summary>
            /// <param name="state">The state that we're attaching the game object to</param>
            /// <param name="parentGamObject">The game object that represents the interactor for that state.</param>
            public void SetGameObject(ControllerStates state, GameObject parentGamObject)
            {
                if (state == ControllerStates.Max || interactors == null)
                {
                    return;
                }

                interactors[(int)state].Attach(parentGamObject);
            }
Ejemplo n.º 11
0
 void OnMouseDown()
 {
     Debug.Log("Mousedown");
     if (playerCharacter.playerState != PlayerCharacter.PlayerStates.Dead && controllerState == ControllerStates.Idle)
     {
         controllerState = ControllerStates.Dragging;
         _rb.isKinematic = true;
         dragOrigin      = playerCharacter.transform.position;
     }
 }
Ejemplo n.º 12
0
    public void Init(ControllerStates states)
    {
        this.states = states;
        dollyDir    = cameraObject.transform.localPosition.normalized; // Локальные координаты камеры
        distance    = cameraObject.transform.localPosition.magnitude;
        Vector3 rot = transform.localRotation.eulerAngles;

        rotY             = rot.y;
        rotX             = rot.x;
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
Ejemplo n.º 13
0
    private void BattleSystem_OnStateChanged(object sender, BattleStateEventArgs e)
    {
        switch (e.value)
        {
        case BattleSystem.BattleStates.Complete:
            controllerState             = ControllerStates.Idle;
            playerCharacter.playerState = PlayerCharacter.PlayerStates.Idle;
            break;

        default:
            break;
        }
    }
Ejemplo n.º 14
0
        private void changeWaypoint(Waypoint waypoint)
        {
            //push current waypoint to history stack
            m_waypointHistory.Push(m_currentWaypoint);

            m_controllerState = ControllerStates.Moving;

            // Do interpolation

            // Change current waypoint on complete
            m_currentWaypoint = waypoint;

            // Dispatch complete event here
        }
Ejemplo n.º 15
0
    private void StartBattle()
    {
        // get enemy
        NonPlayerCharacter enemy = playerCharacter.currentFloor.transform.GetChild(3).GetComponent <NonPlayerCharacter>();

        // set states
        controllerState             = ControllerStates.Battle;
        playerCharacter.playerState = PlayerCharacter.PlayerStates.Fighting;

        // start battle
        BattleSystem battleSystem = BattleSystem.Create(playerCharacter, enemy);

        battleSystem.Start();
        battleSystem.OnStateChanged += BattleSystem_OnStateChanged;
    }
Ejemplo n.º 16
0
            /// <summary>
            /// Attempts to set the current state of a controller.
            /// </summary>
            /// <param name="nextState">The state that we wish to transition to</param>
            public void SetState(ControllerStates nextState)
            {
                if (nextState == currentState || nextState == ControllerStates.Max)
                {
                    return;
                }

                if (currentState != ControllerStates.Max)
                {
                    interactors[(int)currentState].Leave();
                }

                currentState = nextState;
                interactors[(int)currentState].Enter();
            }
        /// <summary>
        /// Attaches a game object that represents an interactor for a state, to a state.
        /// </summary>
        /// <param name="state">The state that we're attaching the game object to</param>
        /// <param name="parentGamObject">The game object that represents the interactor for that state.</param>
        public void SetGameObject(ControllerStates state, GameObject parentGamObject)
        {
            if ((state == ControllerStates.MAX) || (m_Interactors == null))
            {
                return;
            }

            m_Interactors[(int)state].Attach(parentGamObject);

            XRTeleportationController controller = parentGamObject.GetComponent <XRTeleportationController>();

            if (controller)
            {
                TeleportationThreshold = controller.TriggerTeleportThreshold;
            }
        }
Ejemplo n.º 18
0
        public override void ControlState(ControllerStates state)
        {
            ControllerState = state;
            switch (state)
            {
            case ControllerStates.Blank:
                _canSave      = true;
                _canSearch    = true;
                ListEnabled   = true;
                _hasChanges   = false;
                _canPrint     = false;
                _canAddNew    = false;
                CaseNoEnabled = true;
                break;

            case ControllerStates.Edited:
                _canSearch    = false;
                ListEnabled   = false;
                _hasChanges   = true;
                _canPrint     = false;
                _canAddNew    = true;
                CaseNoEnabled = false;
                break;

            case ControllerStates.Saved:
                _canSave   = true;
                _canSearch = false;
                RefreshCaseFollowings();
                ListEnabled   = false;
                _hasChanges   = false;
                _canPrint     = true;
                _canAddNew    = true;
                CaseNoEnabled = false;
                break;

            case ControllerStates.Loaded:
                ListEnabled   = true;
                _hasChanges   = false;
                _canPrint     = true;
                _canAddNew    = true;
                CaseNoEnabled = false;
                break;

            default:
                throw new ArgumentOutOfRangeException("state");
            }
        }
        /// <summary>
        /// Attempts to set the current state of a controller.
        /// </summary>
        /// <param name="nextState">The state that we wish to transition to</param>
        public void SetState(ControllerStates nextState)
        {
            if (nextState == m_State || nextState == ControllerStates.MAX)
            {
                return;
            }
            else
            {
                if (m_State != ControllerStates.MAX)
                {
                    m_Interactors[(int)m_State].Leave();
                }

                m_State = nextState;
                m_Interactors[(int)m_State].Enter();
            }
        }
Ejemplo n.º 20
0
        public override void ControlState(ControllerStates state)
        {
            State = state;
            switch (State)
            {
            case ControllerStates.Blank:
                SearchEnabled         = true;
                EditEnabled           = true;
                _hasChanges           = false;
                _canSave              = false;
                _canDelete            = false;
                OutboxNoEnabled       = true;
                SearchOutboxNoChecked = false;
                SearchSubjectChecked  = true;
                break;

            case ControllerStates.Edited:
                _hasChanges     = true;
                SearchEnabled   = false;
                _canSave        = true;
                _canDelete      = false;
                OutboxNoEnabled = false;
                break;

            case ControllerStates.Saved:
                LoadOutboxes(LatestYear);
                _hasChanges     = false;
                _canDelete      = true;
                OutboxNoEnabled = false;
                break;

            case ControllerStates.Loaded:
                _hasChanges     = false;
                SearchEnabled   = false;
                _canDelete      = true;
                _canSave        = true;
                OutboxNoEnabled = false;
                break;

            default:
                break;
            }
        }
Ejemplo n.º 21
0
    public void init()
    {
        states = new ControllerStates();
        // Получение компоненты аниматора
        m_Animator = GetComponent <Animator>();
        // Получение физической компоненты тела
        m_Rigidbody = GetComponent <Rigidbody>();
        // Получение компоненты коллайдера
        m_Capsule = GetComponent <CapsuleCollider>();
        // Получения высоты перса
        m_CapsuleHeight = m_Capsule.height;
        // Координаты центра перса
        m_CapsuleCenter = m_Capsule.center;

        // Заморозка вращений по всем осям с помощью 8-битной маски 000111000
        m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
        // Длина проверки дистанции до земли
        m_OrigGroundCheckDistance = m_GroundCheckDistance;
    }
Ejemplo n.º 22
0
        public override void ControlState(ControllerStates state)
        {
            State = state;
            switch (State)
            {
            case ControllerStates.Blank:
                _canSave   = true;
                _canSearch = true;
                _canDelete = false;

                RaiseContorllerChanged(ControllerAction.Cleared);
                break;

            case ControllerStates.Edited:
                _canSave   = true;
                _canSearch = false;
                _canDelete = true;

                RaiseContorllerChanged(ControllerAction.Edited);

                break;

            case ControllerStates.Saved:
                _canSave   = true;
                _canSearch = false;
                _canDelete = true;

                RaiseContorllerChanged(ControllerAction.Saved);
                break;

            case ControllerStates.Loaded:
                _canSave   = true;
                _canSearch = false;
                _canDelete = true;

                RaiseContorllerChanged(ControllerAction.Saved);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 23
0
    void Start()
    {
        controller       = GetComponent <Controller2D>();
        controllerStates = controller.controllerStates;
        playerStates     = GetComponent <PlayerStates>();
        animator         = GetComponent <Animator>();

        gravity = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
        print("Gravity:" + gravity);
        maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
        minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight);
        if (controllerStates.faceDir == -1)
        {
            currentDirection = "left";
        }
        else
        {
            currentDirection = "right";
        }
    }
Ejemplo n.º 24
0
        public override void ControlState(ControllerStates state)
        {
            switch (state)
            {
            case ControllerStates.Blank:
                break;

            case ControllerStates.Edited:
                break;

            case ControllerStates.Saved:
                break;

            case ControllerStates.Loaded:
                break;

            default:
                throw new ArgumentOutOfRangeException("state");
            }
        }
Ejemplo n.º 25
0
        public override void ControlState(ControllerStates state)
        {
            _controllerState = state;
            switch (state)
            {
            case ControllerStates.Blank:
                break;

            case ControllerStates.Edited:
                break;

            case ControllerStates.Saved:
                break;

            case ControllerStates.Loaded:
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Sets up the controller
 /// </summary>
 public void Initialize()
 {
     m_State       = ControllerStates.MAX;
     m_Interactors = new InteractorController[(int)ControllerStates.MAX];
 }
Ejemplo n.º 27
0
 public override void ControlState(ControllerStates state)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 28
0
 public abstract void ControlState(ControllerStates state);
Ejemplo n.º 29
0
        private void RefreshState(bool ForceRefershCommandItems)
        {
            ControllerStates orig = this.State;

            _state = ControllerStates.None;

            if (CurrentIsCanShow)
                _state |= ControllerStates.ItemCanShow;

            if (ListIsCanShow)
                _state |= ControllerStates.ListCanShow;

            if (CurrentIsCanEdit)
                _state |= ControllerStates.CanEdit;

            if (CurrentIsCanCancelEdit)
                _state |= ControllerStates.CanCancelEdit;

            if (CurrentIsCanEndEdit)
                _state |= ControllerStates.CanEndEdit;

            if (CurrentIsCanAcceptChanges)
                _state |= ControllerStates.CanAcceptChanges;

            if (CurrentIsCanRejectChanges)
                _state |= ControllerStates.CanRejectChanges;

            if (CurrentIsCanClone)
                _state |= ControllerStates.CanClone;

            if (CurrentIsCanMoveNext)
                _state |= ControllerStates.CanMoveNext;

            if (CurrentIsCanMovePerv)
                _state |= ControllerStates.CanMovePerv;

            if (BatchIsCanAcceptChanges)
                _state |= ControllerStates.CanBatchAcceptChanges;

            if (BatchIsCanRejectChanges)
                _state |= ControllerStates.CanBatchRejectChanges;

            if (IsCanAdd)
                _state |= ControllerStates.CanAdd;

            if (IsCanRemove)
                _state |= ControllerStates.CanRemove;

            if (!BatchIsModifyed)
                _state |= ControllerStates.CanFill;

            if (FillState == FillStates.Filling)
                _state |= ControllerStates.CanCancelFill;


            if (orig != State || ForceRefershCommandItems)
            {
                Commands.RefreshEnabledDefaultCommands();

                OnStateChanged();
            }
        }
Ejemplo n.º 30
0
 /// <summary>
 /// Sets up the controller
 /// </summary>
 public void Initialize()
 {
     currentState = ControllerStates.Max;
     interactors  = new InteractorController[(int)ControllerStates.Max];
 }
Ejemplo n.º 31
0
        private void GetStatus(object state)
        {
            _stopGetStatus = false;
            while (!_stopGetStatus)
            {
                Thread.Sleep(500);
                try
                {
                    var sr = _commander.GetStatus(_session, CurrentDirectionCameras[0].Data);
                    CurrentDirectionCameras.ForEach(each => each.SetStatus(sr));
                    var str = sr.GetStatus(CurrentDirectionCameras[0].Data);
                    var strngs = str.Split(new[] {' '}, 2);
                    if (strngs[0] == "STOP") State = ControllerStates.Stop;
                    else
                    {
                        State = ControllerStates.Unknown;
                    }
                    if (State == ControllerStates.Stop)
                    {
                        _currentData = strngs[1];
                        DateTime dt;
                        DateTime.TryParseExact(_currentData,"dd MMM HH:mm:ss.FFF",new CultureInfo("en-US"),DateTimeStyles.None,out dt);
                    }
                }
                catch (Exception)
                {

                }
            }
        }
Ejemplo n.º 32
0
    /// <summary>
    /// Called by sendRequestXML to determine what to send next.
    /// Corresponds to states Start and *Query states.
    /// </summary>
    /// <param name="sess"></param>
    /// <returns>String</returns>
    public String getNextAction(Session sess)
    {
        if (sess == null)
        {
            throw new Exception("getNextAction: invalid session object");
        }
        String action;

        ControllerStates controllerState = ControllerStates.Preflight;

        if (sess.getProperty("controllerState") != null)
        {
            controllerState = (ControllerStates)sess.getProperty("controllerState");
        }
        ControllerStates lastControllerState = ControllerStates.Preflight;

        if (sess.getProperty("lastControllerState") != null)
        {
            lastControllerState = (ControllerStates)sess.getProperty("lastControllerState");
        }

        switch (controllerState)
        {
        case ControllerStates.Preflight:
            // Ask user if they want to do this update or not
            // if OK,       controllerState=ControllerStates.CustomerAddRq
            // if Cancel,   controllerState=ControllerStates.End
            dbm.SetInteractiveMode(sess.getTicket(), "NEEDED");
            action = "";   //The empty string will trigger getLastError() which will start interactive mode.
            lastControllerState = ControllerStates.Preflight;
            controllerState     = ControllerStates.CustomerAddRq;
            break;

        case ControllerStates.CustomerAddRq:
            // Build and send CustomerAddRq xml
            string[,] customers = dbm.GetAllNewCustomers();
            action = QuickBooksCustomerOps.addCustomers(sess, customers);
            lastControllerState = ControllerStates.CustomerAddRq;
            controllerState     = ControllerStates.CustomerAddRs;
            break;

        case ControllerStates.SalesReceiptAddRq:
            // Build and send SalesReceiptAddRq xml
            string[,] sales     = dbm.GetAllSalesReceipts();
            action              = QuickBooksSalesReceiptOps.addSalesReceipts(sess, sales);
            lastControllerState = ControllerStates.SalesReceiptAddRq;
            controllerState     = ControllerStates.SalesReceiptAddRs;
            break;

        case ControllerStates.ItemInventoryQueryRq:
            // Build and send ItemInventoryQueryRq xml
            action = QuickBooksItemOps.queryAll(sess);
            lastControllerState = ControllerStates.ItemInventoryQueryRq;
            controllerState     = ControllerStates.ItemInventoryQueryRs;
            break;

        case ControllerStates.MoreItemInventoryQueryRq:
            // Build and send more ItemInventoryQueryRq xml
            action = QuickBooksItemOps.queryNext(sess);
            lastControllerState = ControllerStates.MoreItemInventoryQueryRq;
            controllerState     = ControllerStates.ItemInventoryQueryRs;
            break;

        case ControllerStates.Postflight:
            // Show user the data that was updated
            // Only OK,       controllerState=ControllerStates.End
            dbm.SetInteractiveMode(sess.getTicket(), "NEEDED");
            action = "";     //The empty string will trigger getLastError() which will start interactive mode.
            lastControllerState = ControllerStates.Postflight;
            controllerState     = ControllerStates.End;
            break;

        case ControllerStates.End:
            // Send a dummy HostQuery so the control flows into processLastAction()
            lastControllerState = ControllerStates.End;
            action = "<?xml version=\"1.0\" ?><?qbxml version=\"2.0\"?>" +
                     "<QBXML><QBXMLMsgsRq onError = \"stopOnError\"><HostQueryRq requestID = \"0\">" +
                     "<IncludeRetElement>QBFileMode</IncludeRetElement></HostQueryRq></QBXMLMsgsRq></QBXML>";
            break;

        default:
            throw new Exception("getNextAction: Unexpected state: " + controllerState);
        }
        sess.setProperty("lastControllerState", lastControllerState);
        sess.setProperty("controllerState", controllerState);
        return(action);
    }
Ejemplo n.º 33
0
    /// <summary>
    /// Called by receiveResponseXML to process the last data received.
    /// Corresponds to states Get*Response
    /// </summary>
    /// <param name="sess"></param>
    /// <param name="response"></param>
    /// <returns>int</returns>
    public int processLastAction(Session sess, String response)
    {
        int completion = 0;

        ControllerStates controllerState = ControllerStates.Preflight;

        if (sess.getProperty("controllerState") != null)
        {
            controllerState = (ControllerStates)sess.getProperty("controllerState");
        }

        ControllerStates lastControllerState = ControllerStates.Preflight;

        if (sess.getProperty("lastControllerState") != null)
        {
            lastControllerState = (ControllerStates)sess.getProperty("lastControllerState");
        }

        switch (controllerState)
        {
        case ControllerStates.CustomerAddRs:
            //Parse response and store ListIDs in ecommdb->customers
            string[,] customers = QuickBooksCustomerOps.extractCustomerAddResponse(response, sess);
            dbm.SetListID(customers);
            lastControllerState = ControllerStates.CustomerAddRs;
            controllerState     = ControllerStates.SalesReceiptAddRq;
            completion          = 33;
            break;

        case ControllerStates.SalesReceiptAddRs:
            //Parse response and store TxnIDs in ecommdb->sales
            string[,] sales = QuickBooksSalesReceiptOps.extractSalesReceiptAddResponse(response, sess);
            dbm.SetTxnID(sales);
            lastControllerState = ControllerStates.SalesReceiptAddRs;
            controllerState     = ControllerStates.ItemInventoryQueryRq;
            completion          = 66;
            break;

        case ControllerStates.ItemInventoryQueryRs:
            //Parse response and store items in ecommdb->items
            string[,] items = QuickBooksItemOps.extractItemQueryResponses(response, sess);
            dbm.AddItems(items);
            Object queryContext = QuickBooksItemOps.hasMoreData(response, sess);
            if (queryContext != null)
            {
                sess.setProperty("queryContext", queryContext);
                lastControllerState = ControllerStates.ItemInventoryQueryRs;
                controllerState     = ControllerStates.MoreItemInventoryQueryRq;
            }
            else
            {
                lastControllerState = ControllerStates.ItemInventoryQueryRs;
                controllerState     = ControllerStates.Postflight;
                completion          = 88;
            }
            break;

        case ControllerStates.End:
            //Finally, clean up work.
            //Following two lines are commented to be able to re-run the application.

            //For simplicty, we are assuming all customers made it to QB and therefore
            //setting all customers to old. In real application, you would need to check
            //CustomerAddResponse and set them accordingly.
            //dbm.SetCustomerStatus(true);

            //Delete records from sales table. Note above applies to SalesReceipts as well.
            //dbm.DeleteAllSalesReceipts();

            completion = 100;
            break;

        default:
            throw new Exception("processLastAction: Unexpected state: " + controllerState);
        }

        sess.setProperty("lastControllerState", lastControllerState);
        sess.setProperty("controllerState", controllerState);
        return(completion);
    }
            private IEnumerable<ControllerCommandTypes> GetControllerCommandTypes(ControllerStates ControllerState)
            {
                List<ControllerCommandTypes> list = new List<ControllerCommandTypes>();

                foreach (int commandType in DataAvail.Utils.EnumFlags.DecomposeEnum((int)ControllerState))
                {
                    list.AddRange(GetControllerCommandType((ControllerStates)commandType));
                }

                return list.Union(
                    new ControllerCommandTypes[] { ControllerCommandTypes.FocusList, ControllerCommandTypes.FocusSearch, ControllerCommandTypes.ItemClose });
            }
Ejemplo n.º 35
0
 private bool IsCommandAvailable(ControllerStates CommandType)
 {
     return (CommandType & AvailableState) == CommandType;
 }
Ejemplo n.º 36
0
	void ChangeControllerState(CharacterController.ControllerStates state)
	{
		switch(state)
		{
			case ControllerStates.Stand: _currentControllerState = ControllerStates.Stand; _currentStateExecutor = _standStateExecutor; break;
			case ControllerStates.Moving: _currentControllerState = ControllerStates.Moving; _currentStateExecutor = _stepStateExecutor; break;
			case ControllerStates.Turning: _currentControllerState = ControllerStates.Turning; _currentStateExecutor = _turningStateExecutor; break;
			
		}
	}
Ejemplo n.º 37
0
 void Awake()
 {
     m_controllerState = ControllerStates.Positioned;
     m_waypointHistory = new Stack<Waypoint>();
 }
Ejemplo n.º 38
0
        private void RefereshAvailableStates(bool ForceRefershCommandItems)
        {
            ControllerStates orig = AvailableState;

            _availableStates = ControllerStates.CanFill;

            if (CurrentIsShowAvailable)
                _availableStates |= ControllerStates.ItemCanShow;

            if (ListIsShowAvailable)
                _availableStates |= ControllerStates.ListCanShow;

            if (CurrentIsEditAvailable)
                _availableStates |= ControllerStates.CanEdit;

            if (CurrentIsEndEditAvailable)
            {
                _availableStates |= ControllerStates.CanEndEdit;
                _availableStates |= ControllerStates.CanCancelEdit;
            }

            if (CurrentIsModifyAvailable)
            {
                _availableStates |= ControllerStates.CanAcceptChanges;
                _availableStates |= ControllerStates.CanRejectChanges;
            }

            if (CurrentIsMoveAvailable)
            {
                _availableStates |= ControllerStates.CanMoveNext;
                _availableStates |= ControllerStates.CanMovePerv;
            }

            if (CurrentIsCloneAvailable)
            {
                _availableStates |= ControllerStates.CanClone;
            }

            if (IsAddAvailable)
            {
                _availableStates |= ControllerStates.CanAdd;
            }

            if (IsRemoveAvailable)
                _availableStates |= ControllerStates.CanRemove;

            if (BatchIsModifyAvailabe)
            {
                _availableStates |= ControllerStates.CanBatchAcceptChanges;
                _availableStates |= ControllerStates.CanBatchRejectChanges;
            }

            if (orig != AvailableState || ForceRefershCommandItems)
                Commands.RefreshAvailableDeafultCommands();
        }
            private IEnumerable<ControllerCommandTypes> GetControllerCommandType(ControllerStates ControllerStates)
            {
                switch (ControllerStates)
                {
                    case ControllerStates.CanAdd:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.Add };

                    case ControllerStates.CanRemove:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.Remove };

                    case ControllerStates.CanEndEdit:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.EndEdit };

                    case ControllerStates.CanCancelEdit:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.CancelEdit };

                    case ControllerStates.CanAcceptChanges:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.AcceptChanges };

                    case ControllerStates.CanRejectChanges:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.RejectChanges };

                    case ControllerStates.CanClone:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.Clone };

                    case ControllerStates.CanMoveNext:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.MoveNext };

                    case ControllerStates.CanMovePerv:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.MovePerv };

                    case ControllerStates.ItemCanShow:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.ItemSelect, ControllerCommandTypes.ItemShow };

                    case ControllerStates.ListCanShow:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.ListShow };

                    case ControllerStates.CanBatchAcceptChanges:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.BatchAcceptChanges };

                    case ControllerStates.CanBatchRejectChanges:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.BatchRejectChanges };

                    case ControllerStates.CanFill:
                        return new ControllerCommandTypes[] 
                        {
                            ControllerCommandTypes.Fill, 
                            ControllerCommandTypes.UploadToExcel, 
                            ControllerCommandTypes.Refill,
                            ControllerCommandTypes.ListClose
                        };

                    case ControllerStates.CanEdit:
                        return new ControllerCommandTypes[] { ControllerCommandTypes.SelectFkItem, ControllerCommandTypes.AddFkItem };
                }

                return new ControllerCommandTypes[] { };
            }