This is not a project or solution or anything but I’m trying to learn how to build classes with constructors, properties, methods etc. This is what I have so far to start with but I feel like I need little more in the Vehicle class to make this class a little more complete. If someone could assist me on what I need to add to this class from what I have now.
Vehicle class
public class Vehicle
{
private int wins = 0;
private int loses = 0;
/// <summary>
/// Constructor takes one argument for name.
/// </summary>
/// <param name="name"></param>
public Vehicle(string name)
{
Name = name;
}
/// Property that has type driver, driver represents the driver of the vehicle.
public string Name { get; set; }
/// <summary>
/// Public method named StartRace. Returns void, takes integer. Starts race when called.
/// </summary>
/// <param name="laps"></param>
public void StartRace(int laps)
{
/// Winner gets to more than 200 laps, if not you lose.
if (laps > 200)
wins++;
else
loses++;
}
}
Driver class
namespace RaceTrack
{
/// <summary>
///Driver is class type. This driver will drive vehicle.
/// </summary>
public class Driver
{
public int Id { get; set; }
public string Name { get; set; }
}
}
What can I add to the Vehicle class besides what I already have?