-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGarageItem.cs
54 lines (45 loc) · 1.52 KB
/
GarageItem.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
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Text;
namespace Ex03.GarageLogic
{
public class GarageItem
{
private string m_OwnerName;
private string m_OwnerPhoneNumber;
private Vehicle m_Vehicle;
private eVehicleState m_VehicleState = eVehicleState.InRepair;
public GarageItem(string i_OwnerName, string i_OwnerPhoneNumber, Vehicle i_Vehicle)
{
m_OwnerName = i_OwnerName;
m_OwnerPhoneNumber = i_OwnerPhoneNumber;
m_Vehicle = i_Vehicle;
}
public Vehicle Vehicle
{
get { return m_Vehicle; }
}
public eVehicleState State
{
get { return m_VehicleState; }
set { m_VehicleState = value; }
}
public string OwnerPhone
{
get { return m_OwnerPhoneNumber; }
}
public string OwnerName
{
get { return m_OwnerName; }
}
public override string ToString()
{
string sVehicle = m_Vehicle.ToString();
string output = string.Format("Owner Name : {0}" + Environment.NewLine + "Owner Phone number : {1}" +
Environment.NewLine + "Vehicle state : {2}" + Environment.NewLine + sVehicle +
Environment.NewLine
, m_OwnerName, m_OwnerPhoneNumber, m_VehicleState);
return output;
}
}
}