blob: ce7c0e329f261eba0f3c347fb3620fef726d401c (
plain) (
blame)
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
|
package design.model;
import design.model.course_search.ICourse;
import java.util.List;
public class Course implements ICourse {
private final int id;
private final String name;
private final float difficultyRating;
private final String location;
private final int holeCount;
private final int totalPar;
private final List<Hole> holes;
public Course(int id, String name, int difficultyRating, String location, int holeCount, int totalPar, List<Hole> holes) {
this.id = id;
this.name = name;
this.difficultyRating = difficultyRating;
this.location = location;
this.holeCount = holeCount;
this.totalPar = totalPar;
this.holes = holes;
}
public int getId() {
return id;
}
@Override
public String getName() {
return name;
}
@Override
public float getDifficultyRating() {
return difficultyRating;
}
@Override
public String getLocation() {
return location;
}
@Override
public int getHoleCount() {
return holeCount;
}
@Override
public int getTotalPar() {
return totalPar;
}
@Override
public List<Hole> getHoles() {
return holes;
}
@Override
public String toString() {
return String.format("%s (%s) | Holes: %d | Total Par: %d | Difficulty: %.1f",
name, location, holeCount, totalPar, difficultyRating);
}
}
|