-
Notifications
You must be signed in to change notification settings - Fork 0
/
bridge_history_item.h
38 lines (28 loc) · 941 Bytes
/
bridge_history_item.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Created by qzz on 2023/9/24.
//
#ifndef BRIDGE_LEARNING_BRIDGE_LIB_BRIDGE_HISTORY_ITEM_H_
#define BRIDGE_LEARNING_BRIDGE_LIB_BRIDGE_HISTORY_ITEM_H_
#include <iostream>
#include "bridge_move.h"
namespace bridge_learning_env {
struct BridgeHistoryItem {
explicit BridgeHistoryItem(const BridgeMove& move_made) : move(move_made) {
}
BridgeHistoryItem(const BridgeHistoryItem& past_move) = default;
std::string ToString() const;
bool operator==(const BridgeHistoryItem& rhs) const {
return ToString() == rhs.ToString();
}
BridgeMove move;
Player player = -1;
Player deal_to_player = -1;
Suit suit = kInvalidSuit;
int rank = -1;
Denomination denomination = kInvalidDenomination;
int level = -1;
OtherCalls other_call = kNotOtherCall;
};
std::ostream& operator<<(std::ostream& stream, const BridgeHistoryItem& item);
} // namespace bridge
#endif // BRIDGE_LEARNING_BRIDGE_LIB_BRIDGE_HISTORY_ITEM_H_