-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevel.java
More file actions
121 lines (104 loc) · 2.08 KB
/
Level.java
File metadata and controls
121 lines (104 loc) · 2.08 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
* Level.Java
* Authors: Cali Stenson and Clara Smith
* Date: December 5, 2013
* Course: Wellesley College CS230-Data Structures
* Semester: Fall 2013
* Level objects are used as an integral part of the code cracker
* game as nodes within the graph of the game. The levels hold
* information to be accessed in the CodeCracker class.
*/
import ciphers.Cipher;
import java.io.*;
public class Level {
/**
* Instance Variables
*/
private Cipher cipherType;
private String message;
private File storyLine;
private String name;
/**
* Default Constructor
*/
public Level(){};
/**
* Constructor that allows user to set cipherType and storyLine
* @param c Cipher
* @param s File
*/
public Level(Cipher c, String storyFile, String name, String mess) {
cipherType = c;
this.name = name;
message = mess;
try{
storyLine = new File(storyFile);
}catch(Exception e){
System.out.println(e);
}
}
/**
* Getter method
* @return Cipher
*/
public Cipher getCipher(){
return cipherType;
}
/**
* Setter method
* @param c Cipher
*/
public void setCipher(Cipher c){
cipherType = c;
}
/**
* Getter method
* @return String
*/
public String getMessage(){
return message;
}
/**
* Setter method
* @param mess String
*/
public void setMessage(String mess){
message = mess;
}
/**
* Getter method
* @return String
*/
public String getName(){
return name;
}
/**
* Setter method
* @param nam String
*/
public void setName(String nam){
name = nam;
}
/**
* Getter Method
* @return File
*/
public File getStoryLine(){
return storyLine;
}
/**
* Setter method
* @param c Cipher
*/
public void setStoryLine(String storyFile){
try{
storyLine = new File(storyFile);
}catch(Exception e){
System.out.println(e);
}
}
/**
* Class does not include a main method because the level class is
* tested in the CodeCracker class.
*/
}