33 lines
No EOL
790 B
C++
Executable file
33 lines
No EOL
790 B
C++
Executable file
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include "Board.h"
|
|
|
|
using namespace std;
|
|
|
|
class MNode {
|
|
vector<MNode*> children;
|
|
Board state;
|
|
moves mvs;
|
|
int minimax_val;
|
|
string type; //min or max
|
|
|
|
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() const { return state; }
|
|
void setState(Board s) { state = s; }
|
|
moves getMove() const { return mvs; }
|
|
void setMove(moves m) { mvs = m; }
|
|
string getType() { return type; }
|
|
void setType(string t) { type = t; }
|
|
bool hasChildren();
|
|
};
|
|
|
|
void printTree(int depth, MNode* n); |