예제 #1
0
 public void ReceiveCashFromOtherPlayers(Player currentPlayer, int cashAmount)
 {
     foreach (Player player in myTriggerPlayerList)
     {
         if (player.FirstName + " " + player.LastName != currentPlayer.FirstName + " " + currentPlayer.LastName)
         {
             player.SubtractMoney(cashAmount);
             currentPlayer.AddMoney(cashAmount);
         }
     }
     message = $"Received {cashAmount} from each player";
 }
예제 #2
0
파일: Form1.cs 프로젝트: muzamilsajid/Apoly
        private void btnCreatePlayer_Click(object sender, EventArgs e)
        {
            Player = new Player();

            Player.CreatePlayer(txtFirstName.Text, txtLastName.Text);
            Player.AddMoney(1000000000);
            Player.SetColor(Convert.ToInt32(txtColorR.Text), Convert.ToInt32(txtColorG.Text), Convert.ToInt32(txtColorB.Text));
            Player.CurrentTile = myListOfTiles[0];

            myListOfPlayers.Add(Player);
            trigger.myTriggerPlayerList.Add(Player);

            AddPlayersToListBox();

            listBoxPlayers.Enabled = true;
        }
예제 #3
0
 public void ReceiveInterest(Player currentPlayer, int valueInPercent)
 {
     currentPlayer.AddMoney(currentPlayer.Money / valueInPercent);
     message = $"You Received {valueInPercent}% Interest";
 }
예제 #4
0
 public void AddToPlayerCash(Player player, int value)
 {
     player.AddMoney(value);
     message = $"You Received {value.ToString("###,###,###")}";
 }