// Chessboard.h
#include <iostream>
#include <cstdlib>
#include <ctime>
#include "Chessman.h"
// Ignore examining parameter and error.
class Chessboard: private Chessman
{
private:
Chessman * * m_chessboard ;
m_Direction * * m_whichDirectionFrom ;
int m_lenthOfEdge ;
int m_aLargeWeightValue ;
static const int m_NEGATIVE_INFINITY = (1 << 31) ;
// global variables
int m_startX, m_startY, m_endX, m_endY ;
// private methods
int m_weightValue (void) ;
int m_absoluteValue (const int value) ;
int m_larger (const int valA, const int valB) ;
bool m_isReachable (const int x, const int y) ;
void m_printOptimalRoute (const int x, const int y) ;
public:
// Establish a random chessboard, every value of weight between two grids may be negative.
Chessboard (const int lenthOfEdge = 0, const int aLargeWeightValue = 20) ;
int calculateMaxWeightValueAndOptimalRoute (const int startX, const int startY, const int endX, const int endY) ;
void printOptimalRoute (void) ;
~Chessboard (void) ;
} ;
棋盘类头文件C++
最新推荐文章于 2023-06-23 14:30:26 发布