Manages input / output with the file system.
More...
|
| | FileManager (string path) |
| | Initializes a new FileManager.
|
| |
| void | WriteScore (string username, int score, int wave) |
| | Writes a score to the scores file. A score in the scores file follows the "username,score,wave" pattern.
|
| |
| List<(string, int, int)> | GetScores () |
| | Gets the 15 best scoresfound in the scores file.
|
| |
|
| readonly string | _path |
| | Path of the score file.
|
| |
|
| const int | INDEX_OF_USERNAME = 0 |
| | Index of the username in a scores file line.
|
| |
| const int | INDEX_OF_SCORE = 1 |
| | Index of the score in a scores file line.
|
| |
| const int | INDEX_OF_WAVE = 2 |
| | Index of the wave in a scores file line.
|
| |
| const int | NB_SCORES_SHOWN = 15 |
| | Number of scores to display in the high scores menu.
|
| |
| const char | SEPARATOR = ',' |
| | Character used to separate username, score and wave in the score file.
|
| |
Manages input / output with the file system.
◆ FileManager()
| Ch.Etml.IO.FileManager.FileManager |
( |
string | path | ) |
|
Initializes a new FileManager.
- Parameters
-
| path | Location of the score file. |
◆ GetScores()
| List<(string, int, int)> Ch.Etml.IO.FileManager.GetScores |
( |
| ) |
|
Gets the 15 best scoresfound in the scores file.
- Returns
- A list of the 15 highest scores, ordered from best to worst.
◆ WriteScore()
| void Ch.Etml.IO.FileManager.WriteScore |
( |
string | username, |
|
|
int | score, |
|
|
int | wave ) |
Writes a score to the scores file. A score in the scores file follows the "username,score,wave" pattern.
- Parameters
-
| username | Name of the player. |
| score | Score achieved by the player. |
| wave | Wave achieved by the player. |
◆ _path
| readonly string Ch.Etml.IO.FileManager._path |
|
private |
◆ INDEX_OF_SCORE
| const int Ch.Etml.IO.FileManager.INDEX_OF_SCORE = 1 |
|
staticprivate |
Index of the score in a scores file line.
◆ INDEX_OF_USERNAME
| const int Ch.Etml.IO.FileManager.INDEX_OF_USERNAME = 0 |
|
staticprivate |
Index of the username in a scores file line.
◆ INDEX_OF_WAVE
| const int Ch.Etml.IO.FileManager.INDEX_OF_WAVE = 2 |
|
staticprivate |
Index of the wave in a scores file line.
◆ NB_SCORES_SHOWN
| const int Ch.Etml.IO.FileManager.NB_SCORES_SHOWN = 15 |
|
staticprivate |
Number of scores to display in the high scores menu.
◆ SEPARATOR
| const char Ch.Etml.IO.FileManager.SEPARATOR = ',' |
|
staticprivate |
Character used to separate username, score and wave in the score file.
The documentation for this class was generated from the following file:
- D:/Repositories/spicy-invaders/SpicyInvaders/SpicyInvaders/Etml/IO/FileManager.cs