nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
ScoreEntry Struct Reference

A single entry on the high-score file. More...

#include <ScoreFile.hpp>

Public Member Functions

 ScoreEntry ()
 Creates an empty score entry.
 
bool isLike (ScoreEntry &other)
 Tells if both scores were made on exact same game settings.
 

Public Attributes

unsigned int points
 How many points the user got.
 
unsigned int speed
 Under which game speed the score was made.
 
std::string level
 On which level the user made this score.
 
int fruits
 How many fruits at once were allowed on this level.
 
bool random_walls
 If random walls were spawned on this level.
 
bool teleport
 If teleport was enabled on this level.
 
Globals::Game::BoardSize board_size
 How large was the game board on this score.
 
int board_scroll_delay
 
bool board_scroll_left
 
bool board_scroll_right
 
bool board_scroll_up
 
bool board_scroll_down
 

Detailed Description

A single entry on the high-score file.

Definition at line 27 of file ScoreFile.hpp.

Constructor & Destructor Documentation

◆ ScoreEntry()

ScoreEntry::ScoreEntry ( )

Creates an empty score entry.

Since everything is public, access them without thinking twice.

Definition at line 15 of file ScoreFile.cpp.

Member Function Documentation

◆ isLike()

bool ScoreEntry::isLike ( ScoreEntry & other)

Tells if both scores were made on exact same game settings.

Scores are incompatible if they doesn't have the same game settings. It's unfair for a score with less fruits to be compared with one where more fruits were enabled.

Definition at line 30 of file ScoreFile.cpp.

Member Data Documentation

◆ board_scroll_delay

int ScoreEntry::board_scroll_delay

Definition at line 54 of file ScoreFile.hpp.

◆ board_scroll_down

bool ScoreEntry::board_scroll_down

Definition at line 58 of file ScoreFile.hpp.

◆ board_scroll_left

bool ScoreEntry::board_scroll_left

Definition at line 55 of file ScoreFile.hpp.

◆ board_scroll_right

bool ScoreEntry::board_scroll_right

Definition at line 56 of file ScoreFile.hpp.

◆ board_scroll_up

bool ScoreEntry::board_scroll_up

Definition at line 57 of file ScoreFile.hpp.

◆ board_size

Globals::Game::BoardSize ScoreEntry::board_size

How large was the game board on this score.

Note
This is only valid on the Arcade Mode. Levels don't care about it.

Definition at line 52 of file ScoreFile.hpp.

◆ fruits

int ScoreEntry::fruits

How many fruits at once were allowed on this level.

Definition at line 40 of file ScoreFile.hpp.

◆ level

std::string ScoreEntry::level

On which level the user made this score.

It defaults to "", which is the Arcade Mode.

Definition at line 37 of file ScoreFile.hpp.

◆ points

unsigned int ScoreEntry::points

How many points the user got.

Definition at line 30 of file ScoreFile.hpp.

◆ random_walls

bool ScoreEntry::random_walls

If random walls were spawned on this level.

Definition at line 43 of file ScoreFile.hpp.

◆ speed

unsigned int ScoreEntry::speed

Under which game speed the score was made.

Definition at line 33 of file ScoreFile.hpp.

◆ teleport

bool ScoreEntry::teleport

If teleport was enabled on this level.

Definition at line 46 of file ScoreFile.hpp.


The documentation for this struct was generated from the following files: