C
C#2mo ago
Owltávio

How to make a bet system in a Turtle race?

So I'm trying to make a bet system in a turtle race using Tasks, where each player before the race starts can bet on 1 of the turtles in the race, but I don't know how to implement it properly. is there an way that each player can select one of the turtles and win/lose money based on the results?
5 Replies
Owltávio
Owltávio2mo ago
BlazeBin - hacbfnjvhsxg
A tool for sharing your source code with the world!
Angius
Angius2mo ago
You would have to start by differentiating the turtles somehow Giving them an Id or Name property or something That way you can point at the exact turtle that won
Owltávio
Owltávio2mo ago
how could I do that?
Angius
Angius2mo ago
Well, just add a property to a turtle
class Turtle
{
// ...
public string Name { get; set; }
}
class Turtle
{
// ...
public string Name { get; set; }
}
for example
Owltávio
Owltávio2mo ago
Okay, thanks.