nsnake
Classic snake game for the terminal
Public Member Functions | Public Attributes | List of all members
ScoreEntry Struct Reference

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

#include <ScoreFile.hpp>

Public Member Functions

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

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. More...
 
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. More...
 
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 ( )

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

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

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.

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.


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