Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class InfosetHistory {
- public:
- InfosetHistory();
- Card initialDiscardPile;
- std::vector<Card> initialHand;
- std::vector<DrawAction> playerDrawActions;
- std::vector<Card> playerDiscardActions;
- std::vector<DrawAction> opponentDrawActions;
- std::vector<Card> opponentDiscardActions;
- InfosetHistory(Card initialDiscardPile, std::vector<Card> hand);
- InfosetHistory(Card initialDiscardPile, std::vector<Card> hand,
- std::vector<DrawAction> playerDrawActions, std::vector<Card> playerDiscardActions,
- std::vector<DrawAction> opponentDrawActions, std::vector<Card> opponentDiscardActions);
- ...
- template<class Archive>
- void serialize(Archive& ar, const unsigned int version) {
- ar & initialDiscardPile;
- ar & initialHand;
- ar & playerDrawActions;
- ar & playerDiscardActions;
- ar & opponentDrawActions;
- ar & opponentDiscardActions;
- }
- };
- struct DrawAction {
- bool fromDeck;
- Card card;
- DrawAction(){
- fromDeck = false;
- card = Card();
- }
- explicit DrawAction(bool fromDeck) {
- this->fromDeck = fromDeck;
- }
- DrawAction(bool fromDeck, Card& card) {
- this->fromDeck = fromDeck;
- this->card = card;
- }
- ...
- template<class Archive>
- void serialize(Archive& ar, const unsigned int version) {
- ar & fromDeck;
- ar & card;
- }
- };
- class Node {
- public:
- std::vector<Card> allowedActions;
- unsigned int NUM_ACTIONS{};
- std::vector<double> regretSum;
- std::vector<double> strategySum;
- unsigned char phase{};
- Node();
- explicit Node(bool drawOnlyDiscardPile);
- explicit Node(const std::vector<Card>& allowedActions);
- Node(const Node& obj);
- ...
- template<class Archive>
- void serialize(Archive& ar, const unsigned int version) {
- ar & allowedActions;
- ar & NUM_ACTIONS;
- ar & regretSum;
- ar & strategySum;
- ar & phase;
- }
- };
- struct Card {
- int rank;
- int suit;
- Card(){
- this->rank = 0;
- this->suit = 0;
- }
- Card(int rank, int suit) {
- this->rank = rank;
- this->suit = suit;
- }
- ...
- template<class Archive>
- void serialize(Archive& ar, const unsigned int version) {
- ar & rank;
- ar & suit;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement