-
Notifications
You must be signed in to change notification settings - Fork 0
/
Car.cs
41 lines (35 loc) · 834 Bytes
/
Car.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Text;
namespace GRID
{
public class Car
{
private const int MaxFuelAmount = 160;
private int hp;
private double fuelAmount;
private Tyre tyre;
public bool OutOfFuel => FuelAmount < 0;
public Tyre Tyre
{
get { return tyre; }
set { tyre = value; }
}
public double FuelAmount
{
get { return fuelAmount; }
set { fuelAmount = value; }
}
public int HP
{
get { return hp; }
set { hp = value; }
}
public Car(int hp, double fuelAmount, Tyre tyre)
{
this.HP = hp;
this.FuelAmount = fuelAmount;
this.Tyre = tyre;
}
}
}