Пример #1
0
 /// <summary>
 /// Called when the player selects destination for gold
 /// </summary>
 void GoldDestinationSelected_(ButtonValues selection)
 {
     _goldZone       = selection;
     _selectionState = MineSelectionState.CoalDestination;
     Carts[(int)selection].SetContents(MineItemDrop.Gold);
     TxtCommentary.text = _players[_activePlayerIndex].GetPlayerName() + ":\nWhere would you like to place the COAL?";
 }
Пример #2
0
 public Layout()
 {
     buttonValues = new ButtonValues[7];
     for (int i = 0; i < 7; i++)
     {
         buttonValues[i] = new ButtonValues();
     }
 }
Пример #3
0
        public TriggerControllerButton(
            string namePart,
            int button,
            ButtonValues buttonValue,
            string macroName)

            : base(namePart, macroName)
        {
            this.Type        = TriggerType.ControllerButton;
            this.button      = button;
            this.buttonValue = buttonValue;
        }
Пример #4
0
    /// <summary>
    /// Called when the player selects destination for gold
    /// </summary>
    void GoldClaimSelected_(ButtonValues selection)
    {
        // stop the time limit
        _zoneSelectionLimit.Abort();

        // store the selection
        _goldClaimZone  = selection;
        _selectionState = MineSelectionState.None;

        // show carts and enable movement
        StartCoroutine(MoveCartsOn());
        StartCoroutine(Runaround_());
    }
Пример #5
0
        public static ButtonValues GetButtonValues(DateTime initialDate, DateTime finalDate)
        {
            ButtonValues buttonValues = new ButtonValues();

            buttonValues.Payables       = FinancialManager.GetPayables(initialDate, finalDate);
            buttonValues.Receivables    = FinancialManager.GetReceivables(initialDate, finalDate);
            buttonValues.NetPurchases   = PurchasesManager.GetNetPurchases(initialDate, finalDate);
            buttonValues.NetSales       = SalesManager.GetNetSales(initialDate, finalDate);
            buttonValues.GrossPurchases = PurchasesManager.GetGrossPurchases(initialDate, finalDate);
            buttonValues.GrossSales     = SalesManager.GetGrossSales(initialDate, finalDate);
            buttonValues.LaborCostValue = HumanResourcesManager.GetHumanResourcesSpendings(initialDate, finalDate);
            buttonValues.Currency       = "EUR";

            return(buttonValues);
        }
Пример #6
0
        public static ButtonValues GetButtonValues(DateTime initialDate, DateTime finalDate)
        {
            ButtonValues buttonValues = new ButtonValues();

            buttonValues.Payables = FinancialManager.GetPayables(initialDate, finalDate);
            buttonValues.Receivables = FinancialManager.GetReceivables(initialDate, finalDate);
            buttonValues.NetPurchases = PurchasesManager.GetNetPurchases(initialDate, finalDate);
            buttonValues.NetSales = SalesManager.GetNetSales(initialDate, finalDate);
            buttonValues.GrossPurchases = PurchasesManager.GetGrossPurchases(initialDate, finalDate);
            buttonValues.GrossSales = SalesManager.GetGrossSales(initialDate, finalDate);
            buttonValues.LaborCostValue = HumanResourcesManager.GetHumanResourcesSpendings(initialDate, finalDate);
            buttonValues.Currency = "EUR";

            return buttonValues;
        }
Пример #7
0
    /// <summary>
    /// A player has selected an input
    /// </summary>
    /// <param name="playerIndex">The player that selected the input</param>
    /// <param name="selection">The item that was selected</param>
    public void OptionSelected(int playerIndex, ButtonValues selection)
    {
        // if not the active player, ignore
        if (playerIndex == _activePlayerIndex)
        {
            // do the correct action based on the selection state
            switch (_selectionState)
            {
            case MineSelectionState.GoldDestination: GoldDestinationSelected_(selection); break;

            case MineSelectionState.CoalDestination: CoalDestinationSelected_(selection); break;

            case MineSelectionState.GoldClaim: GoldClaimSelected_(selection); break;
            }
        }
    }
Пример #8
0
    /// <summary>
    /// Called when the player selects destination for coal
    /// </summary>
    void CoalDestinationSelected_(ButtonValues selection)
    {
        // can't put coal and gold in the same zone
        if (_goldZone != selection)
        {
            TxtErrorMessage.text = "";
            _coalZone            = selection;
            _selectionState      = MineSelectionState.GoldClaim;
            Carts[(int)selection].SetContents(MineItemDrop.Coal);

            TxtCommentary.text = _players[_activePlayerIndex].GetPlayerName() + ":\nTell the other players where you put the gold.\nYou get " + Truth_Points + " for telling the truth,\nor " + Wrong_Points + " for each player who picks\nthe cart that contains coal";
        }
        else
        {
            TxtErrorMessage.text = "Gold and coal cannot go into same cart";
        }
    }
Пример #9
0
        public CalculatorForm()
        {
            InitializeComponent();

            _buttonValues = new ButtonValues();
            _calculator   = new Calculator();

            foreach (var element in MainGrid.Children)
            {
                if (element is Button)
                {
                    ((Button)element).Click += Button_Click;
                }
            }

            CalculationInput   = _buttonValues.ZERO;
            CalculationHistory = string.Empty;
        }
Пример #10
0
    /// <summary>
    /// Callback for the zone selection timer - called once timer expires
    /// </summary>
    void ZoneSelectionTimeoutCallback_()
    {
        _timeoutOccurred = true;
        var random = UnityEngine.Random.Range(0, 3);

        _goldZone            = (ButtonValues)random;
        _goldClaimZone       = (ButtonValues)random;
        _coalZone            = (ButtonValues)(3 - random);
        TxtErrorMessage.text = "";

        _selectionState = MineSelectionState.None;

        // add items to carts
        Carts[random].SetContents(MineItemDrop.Gold);
        Carts[3 - random].SetContents(MineItemDrop.Coal);

        // show carts and enable movement
        StartCoroutine(MoveCartsOn());
        StartCoroutine(Runaround_());
    }
Пример #11
0
 public Calculator()
 {
     _buttonValues = new ButtonValues();
     firstArgument = null;
 }