-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelDesigner.java
53 lines (40 loc) · 1.04 KB
/
LevelDesigner.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
//---------------------------------------------------------------
//File: LevelDesigner.jave
//Desc: Singleton model class that holds a level
//Creator: Christopehr Zuehlke
//---------------------------------------------------------------
package model;
//Model class for the LevelBuilder
public class LevelDesigner {
//Holdes the current level
Level level;
/**
* set the level to the given
*
* @param level
*/
public void setLevel(Level level) {
this.level = level;
}
/**
* Get the current level
*/
public Level getLevel() {
return level;
}
/**
* reset the designer
*/
public static void reset() {
instance = new LevelDesigner();
}
// Singleton implementation
// prevent direct instantiation outside this class
private LevelDesigner() {
this.level = new Level();
}
private static LevelDesigner instance = new LevelDesigner();
public static LevelDesigner instance() {
return instance;
}
}