-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScenario.java
84 lines (64 loc) · 1.9 KB
/
Scenario.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
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
import java.util.ArrayList;
import CustomExceptions.*;
import Entities.*;
/**
* COMP90041, Sem1, 2023: Final Project
* @author Jule Valendo Halim
* student id: 1425567
* student email: [email protected]
*
* Class containing instance variables regarding scenarios
* Class of scenarios to judge
*/
public class Scenario {
//Instance Variables
private String scenarioName;
private ArrayList < Location > locationArray;
//Constructor
/**
* Default constructor for Scenarios, initializes locationArray
*/
public Scenario(){
locationArray=new ArrayList < Location > ();
}
/**
* Constructor with scenario name provided and initializes instance variables
* @param scenarioName Name of scenario for scenarioName
*/
public Scenario(String scenarioName) {
this.scenarioName = scenarioName;
locationArray = new ArrayList < Location > ();
}
//Public Methods
//Accessors
/**
* Gets the arrayList of locations
* @return Returns an ArrayList of locations, containg all the locations in a scenario
*/
public ArrayList < Location > getLocationArray() {
return locationArray;
}
/**
* Gets the location at a specified position
* @param locationIndex Index of location to be obtained
* @return Returns a location at specified index
*/
public Location getLocation(int locationIndex) {
return locationArray.get(locationIndex);
}
/**
* Gets the name of the scenario
* @return Returns a String of the scenario name
*/
public String getScenarioName() {
return scenarioName;
}
//Mutators
/**
* Adds a location to the scenario
* @param location Location to be added to the scenario
*/
public void addLocation(Location location) {
locationArray.add(location);
}
}