#include <iostream>
#include <algorithm>
#include <vector>
Go to the source code of this file.
|
const std::string | alphabets = "abcdefghijklmnopqrstuvwxyz" |
|
◆ DEBUG_PRINT
#define DEBUG_PRINT |
( |
|
x, |
|
|
|
y |
|
) |
| std::cout << x << ":" << y << std::endl |
Helper to print variables for debugging
Definition at line 15 of file utils.h.
◆ NUM_COLS
◆ NUM_ROWS
◆ BOARD_COLOURS()
void BOARD_COLOURS |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD()
void BOLD |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_BLACK_FG()
void BOLD_BLACK_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_BLUE_FG()
void BOLD_BLUE_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_BRIGHT_GREEN_FG()
void BOLD_BRIGHT_GREEN_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_BROWN_FG()
void BOLD_BROWN_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_CYAN_FG()
void BOLD_CYAN_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_LIGHT_GRAY_FG()
void BOLD_LIGHT_GRAY_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_ORANGE_FG()
void BOLD_ORANGE_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_PINK_FG()
void BOLD_PINK_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_RED_FG()
void BOLD_RED_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BOLD_WHITE_FG()
void BOLD_WHITE_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ BROWN_BG()
void BROWN_BG |
( |
std::string |
x | ) |
|
|
inline |
◆ charPresent()
bool charPresent |
( |
std::string |
str, |
|
|
char |
target |
|
) |
| |
◆ DARK_BLUE_BG()
void DARK_BLUE_BG |
( |
std::string |
x | ) |
|
|
inline |
◆ LIGHT_BLUE_BG()
void LIGHT_BLUE_BG |
( |
std::string |
x | ) |
|
|
inline |
◆ log()
void log |
( |
std::string |
logFilePath, |
|
|
std::string |
str |
|
) |
| |
◆ OFF_WHITE_BG()
void OFF_WHITE_BG |
( |
std::string |
x | ) |
|
|
inline |
◆ PALE_GREEN_FG()
void PALE_GREEN_FG |
( |
std::string |
x | ) |
|
|
inline |
◆ parsePlay()
std::vector<std::string> parsePlay |
( |
std::string |
in | ) |
|
Parses a Play in the format <tiles>-<row>-<column>-<direction>
- Parameters
-
- Returns
- Parsed components
This function shall not throw exceptions.
Definition at line 78 of file utils.cc.
◆ PINK_BG()
void PINK_BG |
( |
std::string |
x | ) |
|
|
inline |
◆ RawTimeToString()
std::string RawTimeToString |
( |
const time_t & |
t | ) |
|
Converts a time_t to a std::string
- Parameters
-
- Returns
- Converted time_t
This function shall not throw exceptions.
Definition at line 127 of file utils.cc.
◆ RED_BG()
void RED_BG |
( |
std::string |
x | ) |
|
|
inline |
◆ squarePresent()
bool squarePresent |
( |
std::vector< Square * > |
s, |
|
|
Square * |
target |
|
) |
| |
Other helper functions
Checks whether a Square* is present in a vector<Square*>
- Parameters
-
s | Vector to search in |
target | Search target |
- Returns
- true if found, false otherwise
This function shall not throw exceptions.
Definition at line 24 of file utils.cc.
◆ TILE_COLOURS()
void TILE_COLOURS |
( |
std::string |
x | ) |
|
|
inline |
◆ tilePresent()
bool tilePresent |
( |
std::vector< Tile * > |
t, |
|
|
Tile * |
target |
|
) |
| |
Checks whether a Tile* is present in a vector<Tile*>
- Parameters
-
t | Vector to search in |
target | Search target |
- Returns
- true if found, false otherwise
This function shall not throw exceptions.
Definition at line 43 of file utils.cc.
◆ alphabets
const std::string alphabets = "abcdefghijklmnopqrstuvwxyz" |
String of alphabets used for input validation
Definition at line 24 of file utils.h.