Exemple #1
0
        private bool IsChangeState()
        {
            Enums.State previousState = this.State;
            if ((CurrentGrowth >= SEEDED) && (CurrentGrowth < ASCENDED))
            {
                this.State = State.Ascended;
            }
            else if ((CurrentGrowth >= ASCENDED) && (CurrentGrowth < ALMOST_RIPE))
            {
                this.State = State.Ascended;
            }
            else if ((CurrentGrowth >= ALMOST_RIPE) && (CurrentGrowth < RIPE))
            {
                this.State = State.AlmostRipe;
            }
            else if ((CurrentGrowth >= RIPE) && (CurrentGrowth < SPOILED))
            {
                this.State = State.Ripe;
            }
            else if (CurrentGrowth >= SPOILED)
            {
                this.State = State.Spoiled;
            }

            return(previousState != State);
        }
Exemple #2
0
        private void btnPurchase_Click(object sender, EventArgs e)
        {
            try
            {
                ResetTimer();
                Operation = Enums.State.Tag;
                PurchaseTagStatus.Text = "";
                double transactionAmount = 10;
                eftposManager.OperatorDisplayType  = 2; // POTENTIALLY THIS IS THE FIELD FOR PRE-AUTH - CHECK TAG EJECTED THEN BILL - SLIGHTLY DIFFERENT WORKFLOW
                eftposManager.CustomerDisplayType  = 0;
                eftposManager.PrinterType          = 0;
                eftposManager.TransactionReference = "PREPAY";
                eftposManager.OperatorID           = "diamondcircle";
                eftposManager.TransSubType         = 0;
                eftposManager.PurchaseAmount       = Convert.ToInt32(Math.Round(transactionAmount * 100));
                eftposManager.CashoutAmount        = 0;

                long errorCode = eftposManager.StartTransaction();

                if (errorCode != 0)
                {
                    PurchaseTagStatus.Text = "Cannot Initialise EFTPOS";
                    throw new System.InvalidOperationException("PurchaseTag: Cannot Initialise EFTPOS");
                }
                else
                {
                    PurchaseTagStatus.Text = "Insert/Swipe/Tap Credit/Debit Card";
                }
            }
            catch (Exception ex)
            {
                GeneralExceptions("PurchaseTagClick", System.Diagnostics.TraceEventType.Critical, ex);
                ReturnToMainMenu();
            }
        }
Exemple #3
0
 public void newMap()
 {
     offset             = currentLocation = Vector2.Zero;
     currentState       = Enums.State.Worldeditor;
     selectedLevelIndex = 0;
     levels             = new List <Level>();
 }
Exemple #4
0
        public State GetProduct()
        {
            Enums.State currentState = this.State;
            CurrentGrowth = 0;
            this.State    = State.Empty;

            return(currentState);
        }
Exemple #5
0
 private void btnSell_Click(object sender, EventArgs e)
 {
     // Sell Bitcoins from existing Wallet
     Operation           = Enums.State.Sell;
     tmrRead.Enabled     = true;
     grpMainMenu.Visible = false;
     grpTapTag.Visible   = true;
     tmrWarning.Enabled  = true;
 }
Exemple #6
0
 private void btnTopUp_Click(object sender, EventArgs e)
 {
     // TOPUP new or exisiting wallet
     Operation             = Enums.State.Buy;
     tmrRead.Enabled       = true;
     grpMainMenu.Visible   = false;
     grpBuyBitcoin.Visible = false;
     grpTapTag.Visible     = true;
     tmrWarning.Enabled    = true;
 }
Exemple #7
0
    // Use this for initialization


    protected void SetUp()
    {
        m_state            = Enums.State.Deactive;
        m_interactionPoint = this.gameObject.GetComponentInChildren <InteractionPoint>();

        if (m_interactionPoint == null)
        {
            Debug.LogWarning("an interactionPoint object is required by the interactable class");
        }
    }
Exemple #8
0
 private void btnBalance_Click(object sender, EventArgs e)
 {
     // Get Balance of Tag
     Operation             = Enums.State.Balance;
     tmrRead.Enabled       = true;
     grpMainMenu.Visible   = false;
     grpBuyBitcoin.Visible = false;
     grpTapTag.Visible     = true;
     tmrWarning.Enabled    = true;
 }
Exemple #9
0
 public static void Error666(int age, int board, Enums.State state)
 {
     if (age == board)
     {
         state = Enums.State.Dead;
     }
     if (age > board)
     {
         throw new Exception(ErrorWithAge);
     }
 }
Exemple #10
0
 public void switchState()
 {
     if (Environment.TickCount - timeSinceLastStateChange < 250)
     {
         return;
     }
     control.switchState();
     if (currentState == Enums.State.Leveleditor)
     {
         currentState = Enums.State.Worldeditor;
     }
     else if (currentState == Enums.State.Worldeditor)
     {
         currentState = Enums.State.Leveleditor;
         control.setLevelEditorTabActive();
     }
 }
Exemple #11
0
        private void clearall()
        {
            Operation             = Enums.State.None; // The operation that we are performing
            CryptoCurrency.Fiat   = 0;
            CryptoCurrency.Amount = 0;

            Price      = 0;
            PIN        = "";
            PublicKey  = "";
            Password   = "";
            PrivateKey = "";

            lblBTCBalance.Text    = "0";
            lblTagID.Text         = "";
            lblStatusMessage.Text = "";
            TagId  = "";
            NewTag = false;
        }
Exemple #12
0
    void GetInput()
    {
        float hNew   = Input.GetAxisRaw(InputNames.horizontalAxis);
        float vNew   = Input.GetAxisRaw(InputNames.verticalAxis);
        float hDelta = hNew - hPrev;
        float vDelta = vNew = vPrev;

        if (Mathf.Abs(hDelta) > 0f && Mathf.Abs(hNew) > 0f && state == Enums.State.Run)
        {
            MovePlayer((int)hNew);
        }


        if (Mathf.Abs(Input.GetAxis(InputNames.horizontalAxis)) > 0f)
        {
            //Debug.Log("Horizontal Axis:" + Input.GetAxis(InputNames.horizontalAxis));
        }

        int v = 0;

        if (Mathf.Abs(vDelta) > 0f)
        {
            v = (int)vNew;
        }
        //jumping
        if ((Input.GetButtonDown("Jump") || v == 1) && state == Enums.State.Run && state == Enums.State.Run)//InputNames.jumpButton))
        {
            //Debug.Log("Jump button pressed");
            state = Enums.State.Jump;
            StartCoroutine(Jump());
        }

        //sliding
        if ((Input.GetButtonDown(InputNames.slideButton) || v == -1) && state == Enums.State.Run)
        {
            //Debug.Log("Slide button pressed");
            state = Enums.State.Slide;
            anim.SetTrigger(slideParam);
        }
        hPrev = hNew;
        vPrev = vNew;
    }
Exemple #13
0
 public Mission(string codeName, Enums.State state)
 {
     CodeName = codeName;
     State    = state;
 }
Exemple #14
0
 /// <summary>
 /// Serializes the enum as a state message.
 /// </summary>
 /// <param name="state">The state.</param>
 public abstract string SerializeAsState(Enums.State state);
Exemple #15
0
 void FinishJump()
 {
     state = Enums.State.Run;
 }
Exemple #16
0
 void FinishSlide()
 {
     state = Enums.State.Run;
 }
 public void switchState()
 {
     if (Environment.TickCount - timeSinceLastStateChange < 250)
         return;
     control.switchState();
     if (currentState == Enums.State.Leveleditor)
         currentState = Enums.State.Worldeditor;
     else if (currentState == Enums.State.Worldeditor)
     {
         currentState = Enums.State.Leveleditor;
         control.setLevelEditorTabActive();
     }
 }
 public void newMap()
 {
     offset = currentLocation = Vector2.Zero;
     currentState = Enums.State.Worldeditor;
     selectedLevelIndex = 0;
     levels = new List<Level>();
 }
Exemple #19
0
 /// <summary>
 /// Serializes the enum as a state message.
 /// </summary>
 /// <param name="state">The state.</param>
 public override string SerializeAsState(Enums.State state)
 {
     return(serializer.Serialize(new { state = Enum.GetName(typeof(Enums.State), state) }));
 }