-
Notifications
You must be signed in to change notification settings - Fork 0
/
Street.cs
93 lines (82 loc) · 2.46 KB
/
Street.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;
using System.Collections.Generic;
public class Street:Buyable
{
private String color;
private int nb_house;
private bool hotel;
private List<int> priceRentHouse;
private int priceRentHotel;
private int priceHouse;
private int priceHotel;
public Street next { get; set; }
public String Color
{
get { return this.color; }
}
public int Nb_house
{
get { return this.nb_house; }
set { this.nb_house = value; }
}
public int PriceRentHotel
{
get { return this.priceRentHotel; }
set { this.priceRentHotel = value; }
}
public List<int> PriceRentHouse
{
get { return this.priceRentHouse; }
set { this.priceRentHouse = value; }
}
public bool Hotel
{
get { return this.hotel; }
set { this.hotel = value; }
}
public int PriceHouse
{
get { return this.priceHouse; }
}
public int PriceHotel
{
get { return this.priceHotel; }
}
public Street(int id, String name, int id_buyer, int basic_price, String color, List<int> priceRentHouse, int priceRentHotel, int nb_house, bool hotel, int priceHouse, int priceHotel) : base(id, name, id_buyer, basic_price)
{
//this.basic_price = basic_price;
this.color = color;
this.nb_house = nb_house;
this.hotel = false;
this.priceRentHouse = priceRentHouse;
this.priceRentHotel = priceRentHotel;
this.priceHouse = priceHouse;
this.priceHotel = priceHotel;
}
public override String toString()
{
String output = "Case [id: "+this.id+", name: "+this.name;
if (this.basic_price == -1)
{
output += "]";
}
else
{
output += ", Basic price: "+this.basic_price;
if (this.nb_house == -1)
{
output += "]";
}
else
{
output += ", Color: "+this.color+", Nb house: "+this.nb_house+", Hotel on it: "+this.hotel+", Id buyer: "+this.id_buyer+", Price Rent houses: "+this.priceRentHouse[0];
for (int i=1; i<this.priceRentHouse.Count; i++)
{
output += "-"+this.priceRentHouse[i];
}
output += "], Price Rent Hotel: "+this.priceRentHotel+", Price House: "+this.priceHouse+", Price Hotel: "+this.priceHotel+"]";
}
}
return output;
}
}