-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoomTypeC.java
35 lines (31 loc) · 884 Bytes
/
RoomTypeC.java
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
package Hotel;
public class RoomTypeC extends Room
{
private int minpeople;
private int mindays;
public int getMinPeople(){ return minpeople;}
public void setMinPeople(int a){minpeople = a;}
public int getMinDays(){return mindays;}
public void setMinDays(int b){mindays=b;}
private boolean b;
public boolean add_res(Reservation res)//õðåñêáëçøç ôçò add_res(ðëåïí åëåã÷åé êáé áí ôá áôïìá êáé ïé çìåñåò îåðåñíáíå ôï minimum ôïõ äùìáôéïõ
{
for(i=res.getArrival(); i<res.getArrival()+res.getResdays();i++)
{
if(pd[i]==null && res.getPeople()<=this.getMaxPeople() && res.getPeople()>=getMinPeople() && res.getResdays()>=getMinDays())
{
res.setRoom(this);
for(i=res.getArrival(); i<res.getArrival()+res.getResdays();i++)
{
pd[i]= res;
}
b=true;
}
else
{
b=false;
}
}
return b;
}
}