There's something wrong with my while loop (in my Form class), but basically, it tests to see who the winner of the "race" is in my application, and it also starts the application (Shark.Swim). Once it finds out who the winner is, it needs to get to the "payout" method in my Bet Class.
So here's what I have.
INSTANCE VARIABLES
private Shark[] sharks;
private Guy[] guys;
private Guy selectedGuy;
private Bet[,] bets;
private int[] winners = new int[4];
public Bet betClass;
public int selectedGuyIndex;
WHILE LOOP:
private void raceBtn_Click(object sender, EventArgs e)
{
public int[] finishingOrder = new int[4];
bool sharkFinished = false;
public int place = 1;
public int numSharksFinished;
while (numSharksFinished < 4)
{
sharkFinished = false;
for (int i = 0; i < 4; i++)
{
if (finishingOrder[i] == -1)
{
if (sharks[fish].Swim();)
{
finishedOrder[i] = place;
sharkFinished = true;
numSharksFinished++;
}
}
if(sharkFinished = true)
{
place++;
}
}
}
PAYOUT METHOD:
public double payout(int pool, int sharkPool)
{
for (int j = 0; j < 3; j++)
{
Guy[j].cash += Bets[i, j].Amount;
}
}
I think my best bet is moving the "payout" method to the main forms class, because there is no instance of the "Bets" Array in my Bet class. If you have any questions, ask away, and thanks in advance!