-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHighScores.java
More file actions
102 lines (96 loc) · 2.95 KB
/
Copy pathHighScores.java
File metadata and controls
102 lines (96 loc) · 2.95 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
import java.io.*;
import java.awt.*;
/**
* Creates a HighScore object to track the best scores in the game
* Class currently unused and unfinished due to time constraints
*
* @AviRuthen
* @3/17/21
*/
public class HighScores implements Serializable
{
String name, date;
int score, moves;
int[][][] squareMoves;
String difficulty = "Medium";
/**
* Creates a HighScore object with all key info
*
* @param name: name of person who set high score
* @param score: the score that person set
* @param date: when the person set score (called in Time.java)
*/
public HighScores(String name, int score, String date, int moves)
{
this.name = name.replace(" ", "");
this.score = score;
this.date = date;
this.moves = moves;
}
/**
* Creates a HighScore object with all key info
*
* @param name: name of person who set high score
* @param score: the score that person set
* @param date: when the person set score (called in Time.java)
* @param squareMoves: saves maze generation
*/
public HighScores(String name, int score, String date, int moves, int[][][] squareMoves)
{
this.name = name.replace(" ", "");
this.score = score;
this.date = date;
this.moves = moves;
this.squareMoves = squareMoves;
}
/**
* Creates a HighScore object with all key info
*
* @param name: name of person who set high score
* @param score: the score that person set
* @param date: when the person set score (called in Time.java)
* @param squareMoves: saves maze generation
* @param difficulty: saves difficulty
*/
public HighScores(String name, int score, String date,
int moves, int[][][] squareMoves, String difficulty)
{
this.name = name.replace(" ", "");
this.score = score;
this.date = date;
this.moves = moves;
this.squareMoves = squareMoves;
this.difficulty = difficulty;
}
/**
* Neatly puts all information regarding the high score for
* Adding to text file
*
* @return a String with all info (used in writing HighScores.ser)
*/
public String getInfo()
{
return name + " scored " + score + " at " + date + " in " + moves + " moves on " + difficulty + " mode.";
}
/**
* Overrides S.o.p, used for debugging
*
* @return String to be printed
*/
@Override
public String toString()
{
return name + " scored " + score + " at " + date + " in " + moves + " moves on " + difficulty + " mode.";
}
/**
* Adds maze from HighScores object back into graphics window
*/
public void loadMaze()
{
//numSquaresAcross, numSquaresDown, ScreenWidth
Maze m = new Maze(12, 9, (810/12));
m.squareMoves = squareMoves;
m.generateMaze();
m.findSolution();
}
}