private void Pressed()
    {
        holdTime = 0.0f;

        // Fetch the controller
        Simulation           sim        = Simulation.Instance;
        SimulationController controller = sim.Controller;

        // Propagate the message
        Message message = new Message((int)MessageDestination.MENU_START_PRESSED, "", this);

        controller.PropagateMessage(message);
    }
Exemple #2
0
    /// <summary>
    /// Perform a check to see if the button has been held down for long enough, if so, a message is passed
    /// to the simulation to choose the next decision.
    /// </summary>
    private void CheckHoldTime()
    {
        // The button is now pressed
        if (holdTime >= timeUtilPressed)
        {
            // Create the message to be passed
            Message message = new Message((int)MessageDestination.DECISION_UI_CHOICE, "", selectionChoice);

            // Propagate the message over the simulation controller
            SimulationController simController = Simulation.Instance.Controller;
            simController.PropagateMessage(message);

            // Reset the hold time to prevent constant pressing
            holdTime = 0.0f;
        }
    }