Beispiel #1
0
 internal HoldingEventArgs(uint pointerId, PointerDeviceType type, Point position, HoldingState state)
 {
     PointerId         = pointerId;
     PointerDeviceType = type;
     Position          = position;
     HoldingState      = state;
 }
 internal void OnCellHolding(DataGridCellInfo cellInfo, HoldingState holdingState)
 {
     if (cellInfo.Column.IsCellFlyoutEnabled && holdingState == HoldingState.Started)
     {
         this.CommandService.ExecuteCommand(Telerik.UI.Xaml.Controls.Grid.Commands.CommandId.CellFlyoutAction, new CellFlyoutActionContext(cellInfo, true, CellFlyoutGesture.Holding));
     }
 }
Beispiel #3
0
            private void TryEndHolding(HoldingState state)
            {
                Debug.Assert(state != HoldingState.Started);

                StopHoldingTimer();

                if (_holdingState == HoldingState.Started)
                {
                    _holdingState = state;
                    _recognizer.Holding?.Invoke(_recognizer, new HoldingEventArgs(Down.PointerId, PointerType, Down.Position, state));
                }
            }
    // Start is called before the first frame update
    void Start()
    {
        player            = GameObject.Find("Player").GetComponent <Player>(); // get the Player script
        isPlayerHolding   = player.isHolding;                                  // set the isPlayerHolding bool
        playerHoldingName = player.holdingName;                                // set the name of what the player is holding
        holdingState      = player.holdingState;

        santasSack = GameObject.Find("Santa Bag").GetComponent <SantasSack>(); // get the SantasSack script
        toyList    = santasSack.toyList;                                       // set the list of toys from SantasSack

        holdingIndicator   = GameObject.Find("Holding Indicator");
        holdingIndicatorSR = GameObject.Find("Holding Indicator").GetComponent <SpriteRenderer>();

        holdingText = GameObject.Find("Player Holding UI").GetComponentInChildren <TextMeshProUGUI>(); // get the TextMesh Pro UGUI
    }
Beispiel #5
0
            public void SwitchState(HandGesture inputType)
            {
                BaseInputState state = null;

                switch (inputType)
                {
                case HandGesture.Touching:
                    state = new TouchingState(m_InputTouch);
                    break;

                case HandGesture.Click:
                    state = new ClickState(m_InputTouch);
                    break;

                case HandGesture.Holding:
                    state = new HoldingState(m_InputTouch);
                    break;

                case HandGesture.Drag:
                    state = new DragState(m_InputTouch);
                    break;

                case HandGesture.Slip:
                    state = new SlipState(m_InputTouch);
                    break;

                case HandGesture.Realease:
                    state = new ReleaseState(m_InputTouch);
                    break;

                default:
                    state = new NoneInput(m_InputTouch);
                    break;
                }
                if (state != null)
                {
                    Switch(state);
                }
                else
                {
                    Debug.Log("InputStateFSM.SwitchState " + inputType + "is None");
                }
            }
 public HoldingEventArgs(object source, RoutedEvent arg1, Point p, ulong device, HoldingState holdingState) : this(NoesisGUI_PINVOKE.new_HoldingEventArgs(Noesis.Extend.GetInstanceHandle(source), RoutedEvent.getCPtr(arg1), ref p, device, (int)holdingState), true)
 {
 }
 public CellHoldingContext(DataGridCellInfo cellInfo, HoldingState holdingState)
 {
     this.CellInfo     = cellInfo;
     this.HoldingState = holdingState;
 }
        private async Task HandleAirplaneHolding(Airplane airplane, IDictionary <string, AirplaneState> future)
        {
            HoldingState holdingState = (HoldingState)airplane.AirplaneState;
            FlightPlan   flightPlan   = airplane.FlightPlan;

            // Case 1: airplane holding at destination airport
            if (holdingState.Fix == flightPlan.Destination)
            {
                // Grant approach clearance if no other airplane is cleared for approach at the same airport.
                if (!future.Values.OfType <ApproachState>().Any(state => state.Airport == flightPlan.Destination))
                {
                    future[flightPlan.CallSign] = new ApproachState(flightPlan.Destination);
                    await SendInstructionAsync(flightPlan.CallSign, new ApproachClearance(flightPlan.Destination)).ConfigureAwait(false);

                    if (logger_.IsEnabled(LogLevel.Debug))
                    {
                        logger_.LogDebug(LoggingEvents.InstructionIssued, null,
                                         "ATC: Airplane {CallSign} is has been cleared for approach at {Destination}",
                                         flightPlan.CallSign,
                                         flightPlan.Destination.Name);
                    }
                }
                else
                {
                    future[flightPlan.CallSign] = new HoldingState(flightPlan.Destination);

                    if (logger_.IsEnabled(LogLevel.Debug))
                    {
                        // Technically no new instruction has been issued, but the old instruction remains in place,
                        // so we will reuse InstructionIssued event here
                        logger_.LogDebug(LoggingEvents.InstructionIssued, null,
                                         "ATC: Airplane {CallSign} should continue holding at {Destination} because of other traffic landing",
                                         flightPlan.CallSign,
                                         flightPlan.Destination.Name);
                    }
                }

                return;
            }

            // Case 2: holding at some point enroute
            Fix nextFix = flightPlan.GetNextFix(holdingState.Fix);

            if (future.Values.OfType <EnrouteState>().Any(enrouteState => enrouteState.To == nextFix))
            {
                future[flightPlan.CallSign] = holdingState;

                if (logger_.IsEnabled(LogLevel.Debug))
                {
                    logger_.LogDebug(LoggingEvents.InstructionIssued, null,
                                     "ATC: Airplane {CallSign} should continue holding at {Fix} because of traffic contention at {DesiredFix}",
                                     flightPlan.CallSign,
                                     holdingState.Fix.Name,
                                     nextFix.Name);
                }
            }
            else
            {
                future[flightPlan.CallSign] = new EnrouteState(holdingState.Fix, nextFix);
                // We always optmimistically give an enroute clearance all the way to the destination
                await SendInstructionAsync(flightPlan.CallSign, new EnrouteClearance(flightPlan.Destination, flightPlan.FlightPath));

                if (logger_.IsEnabled(LogLevel.Debug))
                {
                    logger_.LogDebug(LoggingEvents.InstructionIssued, null,
                                     "ATC: Airplane {CallSign} should end holding at {Fix} and proceed to destination. Next fix {NextFix}. Issued new enroute clearance.",
                                     flightPlan.CallSign,
                                     holdingState.Fix.Name,
                                     nextFix.Name);
                }
            }
        }