Ejemplo n.º 1
0
        /// <summary>
        /// Called once a week, gives player money!
        /// </summary>
        void PayDay(object sender, PlayerIndexEventArgs e)
        {
            Random n = new Random();

            int pay = (int)(n.Next(20,31) * 7.25f);
            ((CalendarEvent)sender).Amount = pay;
            GlobalVariables.Finance.Cash += pay;
            Transaction temp = new Transaction("Pay Check (in cash)", pay);
            GlobalVariables.Finance.Transactions.Add(temp);
        }
Ejemplo n.º 2
0
        void PayCredit(object sender, PlayerIndexEventArgs e)
        {
            GlobalVariables.Finance.CreditCardMonthBalance += amount;

            Transaction temp = new Transaction(title, amount);
            GlobalVariables.Finance.Transactions.Add(temp);

            OnPaid();

            payment.Completed = true;
        }
Ejemplo n.º 3
0
        void Withdraw(object sender, PlayerIndexEventArgs e)
        {
            if (GlobalVariables.Finance.BankBalance >= transfer && transfer > 0)
            {
                GlobalVariables.Finance.Cash += transfer;
                GlobalVariables.Finance.BankBalance -= transfer;

                Transaction temp = new Transaction("Bank Withdrawal", transfer);
                GlobalVariables.Finance.Transactions.Add(temp);

                transfer = 0;
            }
        }
Ejemplo n.º 4
0
        void PayCash(object sender, PlayerIndexEventArgs e)
        {
            if (GlobalVariables.Finance.Cash >= amount)
            {
                GlobalVariables.Finance.Cash -= amount;
                if (title == "Credit Card Payment")
                    GlobalVariables.Finance.CreditCardBalance -= amount;

                Transaction temp = new Transaction(title, amount);
                GlobalVariables.Finance.Transactions.Add(temp);

                OnPaid();

                payment.Completed = true;
            }
        }
Ejemplo n.º 5
0
        void Deposit(object sender, PlayerIndexEventArgs e)
        {
            if (GlobalVariables.Finance.Cash >=transfer && transfer > 0)
            {
                GlobalVariables.Finance.BankBalance += transfer;
                GlobalVariables.Finance.Cash -= transfer;

                Transaction temp = new Transaction("Bank Deposit",transfer);
                GlobalVariables.Finance.Transactions.Add(temp);

                transfer = 0;

            }
        }