30 lines
681 B
C
30 lines
681 B
C
![]() |
#pragma once
|
||
|
|
||
|
#include <iostream>
|
||
|
#include <vector>
|
||
|
#include "Board.h"
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
class MNode {
|
||
|
vector<MNode*> children;
|
||
|
Board state;
|
||
|
moves mvs;
|
||
|
int minimax_val;
|
||
|
|
||
|
public:
|
||
|
MNode();
|
||
|
MNode(Board s, moves m, int mmval);
|
||
|
MNode(const MNode& n);
|
||
|
vector<MNode*> getChildren() const { return children; }
|
||
|
void addChild(MNode* n) { children.push_back(n); }
|
||
|
int getMMVal() const { return minimax_val; }
|
||
|
void setMMVal(int mmval);
|
||
|
Board getState() { return state; }
|
||
|
void setState(Board s) { state = s; }
|
||
|
moves getMove() { return mvs; }
|
||
|
void setMove(moves m) { mvs = m; }
|
||
|
bool hasChildren();
|
||
|
};
|
||
|
|
||
|
void printTree(int depth, const MNode& n);
|