Exemplo n.º 1
0
        private void Timeflow_Tick(object sender, EventArgs e)
        {
            flowing++;
            int Timposit, Trent;

            Flowinglbl.Content = flowing.ToString();
            Trent = 0;
            foreach (Building item in BuildingList)
            {
                if ((item.IMG.Background != greenBrush) && (item.Owner != null))
                {
                    Rent                      = (int)(item.price * 0.005);
                    item.Owner.Money         += Rent;
                    MoneyDisplaylabel.Content = owner.Money.ToString();
                    Trent                    += Rent;
                }
            }
            RenttextBox.Clear();
            if (Trent > 0)
            {
                RenttextBox.Text += "+" + Trent.ToString();
            }
            else if (Trent == 0)
            {
                RenttextBox.Text += Trent.ToString();
            }
            else if (Trent < 0)
            {
                RenttextBox.Text += Trent.ToString();
            }

            if (flowing % 7 == 0)
            {
                Timposit = 0;
                foreach (Building item in BuildingList)
                {
                    if ((item.IMG.Background != greenBrush) && (item.Owner != null))
                    {
                        Imposit                   = (int)(r.Next(20, 51) * 0.3 * item.Owner.PlayerProps.Count);
                        item.Owner.Money         -= Imposit;
                        MoneyDisplaylabel.Content = owner.Money.ToString();
                        Timposit                 += Imposit;
                    }
                }
                DecisionBuyPanel.Visibility  = Visibility.Hidden;
                DecisionSellPanel.Visibility = Visibility.Hidden;
                WONpanel.Visibility          = Visibility.Hidden;

                Timposit             /= 7;
                ImpositstextBox.Text += "-" + Timposit.ToString() + "\r\n";
            }
            if (flowing % 30 == 0)
            {
                RenttextBox.Clear();
                ImpositstextBox.Clear();
            }
        }
Exemplo n.º 2
0
        private void Timeflow_Tick(object sender, EventArgs e)
        {
            flowing++;
            int Timposit, Trent;

            Flowinglbl.Text = flowing.ToString();
            Trent           = 0;
            foreach (Building item in BuildingList)
            {
                if ((item.PB.BackColor != Color.Green) && (item.Owner != null))
                {
                    Rent                               = (int)(item.price * 0.005);
                    item.Owner.Money                  += Rent;
                    MoneyDisplaylabel.Text             = owner.Money.ToString();
                    DecisionSuccessSoldPanel.Visible   = false;
                    DecisionSuccessBoughtPanel.Visible = false;
                    DecisionNoMoneyPanel.Visible       = false;
                    Trent                             += Rent;
                }
            }
            RenttextBox.Clear();
            RenttextBox.Text += "+" + Trent.ToString();
            if (flowing % 7 == 0)
            {
                Timposit = 0;
                foreach (Building item in BuildingList)
                {
                    if ((item.PB.BackColor != Color.Green) && (item.Owner != null))
                    {
                        Imposit                   = (int)(r.Next(20, 51) * 0.3 * item.Owner.PlayerProps.Count);
                        item.Owner.Money         -= Imposit;
                        MoneyDisplaylabel.Text    = owner.Money.ToString();
                        DecisionBuyPanel.Visible  = false;
                        DecisionSellPanel.Visible = false;
                        WONpanel.Visible          = false;
                        Timposit                 += Imposit;
                    }
                }
                Timposit             /= 7;
                ImpositstextBox.Text += "-" + Timposit.ToString() + "\r\n";
            }
            if (flowing % 30 == 0)
            {
                RenttextBox.Clear();
                ImpositstextBox.Clear();
            }
        }