public void buildRandomCar() { Array bodyValues = Enum.GetValues(typeof(BodyTypes)); Array wheelValues = Enum.GetValues(typeof(WheelTypes)); body = (BodyTypes)bodyValues.GetValue(Util.randomBetween(0, bodyValues.Length)); frontWheels = (WheelTypes)wheelValues.GetValue(Util.randomBetween(0, wheelValues.Length)); backWheels = (WheelTypes)wheelValues.GetValue(Util.randomBetween(0, wheelValues.Length)); }
public void updateSelectedWheel(int index, bool front) { if (front) { frontWheels = (WheelTypes)index; } else { backWheels = (WheelTypes)index; } }
public Vehicle(WheelTypes wt, Gearbox g) { gear = g; wheelType = wt; }
public Vehicle(WheelTypes wt) : this(wt, new Gearbox()) { }