⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gameboard.h

📁 C++高级编程这本书所附的源代码
💻 H
字号:
// GameBoard.hclass GamePiece {};class GameBoard{ public:  // The general-purpose GameBoard allows the user to specify its dimensions  GameBoard(int inWidth = kDefaultWidth, int inHeight = kDefaultHeight);  GameBoard(const GameBoard& src); // copy constructor  ~GameBoard();  GameBoard& operator=(const GameBoard& rhs); // assignment operator  void setPieceAt(int x, int y, const GamePiece& inPiece);  GamePiece& getPieceAt(int x, int y);  const GamePiece& getPieceAt(int x, int y) const;  int getHeight() const { return mHeight; }  int getWidth() const { return mWidth; }  static const int kDefaultWidth = 10;  static const int kDefaultHeight = 10; protected:  void copyFrom(const GameBoard& src);  // objects dynamically allocate space for the game pieces.  GamePiece** mCells;  int mWidth, mHeight;};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -