Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
message.h
Go to the documentation of this file.
1#ifndef MESSAGE_H
2#define MESSAGE_H
3
4#include "message_type.h"
5#include "chess_color.h"
6#include "piece_type.h"
7
8#include <iosfwd>
9#include <vector>
10
15{
16public:
17 explicit message(
18 const message_type set,
19 const chess_color c,
20 const piece_type pc
21 );
22 auto get_message_type() const noexcept { return m_message_type; }
23 auto get_color() const noexcept { return m_chess_color; }
24 auto get_piece_type() const noexcept { return m_piece_type; }
25 private:
26
27 message_type m_message_type;
28 chess_color m_chess_color;
29 piece_type m_piece_type;
30};
31
33std::vector<message> get_all_messages() noexcept;
34
36void test_message();
37
38std::string to_str(const message& m) noexcept;
39
40std::ostream& operator<<(std::ostream& os, const message& m) noexcept;
41
42#endif // MESSAGE_H
chess_color
A chess piece color.
Definition chess_color.h:10
A message.
Definition message.h:15
auto get_piece_type() const noexcept
Definition message.h:24
auto get_message_type() const noexcept
Definition message.h:22
auto get_color() const noexcept
Definition message.h:23
std::vector< message > get_all_messages() noexcept
Create all possible messages.
Definition message.cpp:18
std::string to_str(const message &m) noexcept
Definition message.cpp:76
void test_message()
Test this class and its free functions.
Definition message.cpp:39
message_type
The type of a message.
Definition message_type.h:10
piece_type
The type of chess piece.
Definition piece_type.h:9