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"; }
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; }
public void ReceiveInterest(Player currentPlayer, int valueInPercent) { currentPlayer.AddMoney(currentPlayer.Money / valueInPercent); message = $"You Received {valueInPercent}% Interest"; }
public void AddToPlayerCash(Player player, int value) { player.AddMoney(value); message = $"You Received {value.ToString("###,###,###")}"; }