Cluedo Solver v1.0
Cluedo game solver making deductions.
Loading...
Searching...
No Matches
Card.hpp File Reference
#include <array>
#include <cstdint>
#include <string_view>

Go to the source code of this file.

Classes

struct  Cluedo::CardUtils
 A series of utilities for the cards. More...
 
struct  Cluedo::CardUtils::CardIterator
 An iterator for cards. More...
 
struct  Cluedo::CardUtils::cards
 Helper class for iterator on all the cards. More...
 
struct  Cluedo::CardUtils::cards_per_category
 Helper class for iterator on all the cards of a category. More...
 

Macros

#define _ENUMERATE_SUSPECTS
 Enumerates the suspect cards.
 
#define _ENUMERATE_WEAPONS
 Enumerates the weapon cards.
 
#define _ENUMERATE_ROOMS
 Enumerates the room cards.
 
#define _ENUMERATE_CARDS
 Enumerates all the cards.
 
#define _ENUMERATE_CARD(x)
 

Enumerations

enum class  Cluedo::CardCategory : std::uint8_t { Suspect = 0 , Weapon = 6 , Room = 12 }
 The categories of the cards in Cluedo. More...
 
enum class  Cluedo::Card : std::uint8_t { _ENUMERATE_CARD , _Count }
 All the cards in Cluedo.
 

Functions

std::string_view Cluedo::format_as (CardCategory category)
 
std::string_view Cluedo::format_as (Card card)
 

Detailed Description

The file that contains data about Cluedo cards.

Macro Definition Documentation

◆ _ENUMERATE_CARD

#define _ENUMERATE_CARD ( x)
Value:
x,

◆ _ENUMERATE_CARDS

#define _ENUMERATE_CARDS
Value:
_ENUMERATE_SUSPECTS \
_ENUMERATE_WEAPONS \
_ENUMERATE_ROOMS

Enumerates all the cards.

◆ _ENUMERATE_ROOMS

#define _ENUMERATE_ROOMS
Value:
_ENUMERATE_CARD(BilliardRoom) \
_ENUMERATE_CARD(Ballroom) \
_ENUMERATE_CARD(DiningRoom) \
_ENUMERATE_CARD(Greenhouse) \
_ENUMERATE_CARD(Hall) \
_ENUMERATE_CARD(Kitchen) \
_ENUMERATE_CARD(Library) \
_ENUMERATE_CARD(Lounge) \
_ENUMERATE_CARD(Study)

Enumerates the room cards.

◆ _ENUMERATE_SUSPECTS

#define _ENUMERATE_SUSPECTS
Value:
_ENUMERATE_CARD(Green) \
_ENUMERATE_CARD(Mustard) \
_ENUMERATE_CARD(Orchid) \
_ENUMERATE_CARD(Peacock) \
_ENUMERATE_CARD(Plum) \
_ENUMERATE_CARD(Scarlet)

Enumerates the suspect cards.

◆ _ENUMERATE_WEAPONS

#define _ENUMERATE_WEAPONS
Value:
_ENUMERATE_CARD(Candlestick) \
_ENUMERATE_CARD(Knife) \
_ENUMERATE_CARD(Pipe) \
_ENUMERATE_CARD(Pistol) \
_ENUMERATE_CARD(Rope) \
_ENUMERATE_CARD(Wrench)

Enumerates the weapon cards.

Enumeration Type Documentation

◆ CardCategory

enum class Cluedo::CardCategory : std::uint8_t
strong

The categories of the cards in Cluedo.

Enumerator
Suspect 

Suspect cards.

Weapon 

Weapon cards.

Room 

Room cards.

Function Documentation

◆ format_as() [1/2]

std::string_view Cluedo::format_as ( Card )

Formats the card as a string.

Note
This function is meant to be used by the {fmt} library to format the cards correctly.

◆ format_as() [2/2]

std::string_view Cluedo::format_as ( CardCategory )

Formats the card category as a string.

Note
This function is meant to be used by the {fmt} library to format the card categories correctly.