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

📄 gameboard.h

📁 C++高级编程这本书所附的源代码
💻 H
字号:
#include <stdexcept>#include <new>using std::bad_alloc;using std::out_of_range;class GamePiece {};class GameBoard{ public:  GameBoard(int inWidth = kDefaultWidth, int inHeight = kDefaultHeight)    throw(bad_alloc);  GameBoard(const GameBoard& src) throw(bad_alloc);  ~GameBoard() throw();  GameBoard& operator=(const GameBoard& rhs) throw(bad_alloc);  void setPieceAt(int x, int y, const GamePiece& inPiece)    throw(out_of_range);  GamePiece& getPieceAt(int x, int y) throw(out_of_range);  const GamePiece& getPieceAt(int x, int y) const throw(out_of_range);  int getHeight() const throw() { return mHeight; }  int getWidth() const throw() { return mWidth; }  static const int kDefaultWidth = 100;  static const int kDefaultHeight = 100; protected:  void copyFrom(const GameBoard& src) throw(bad_alloc);  GamePiece** mCells;  int mWidth, mHeight;};

⌨️ 快捷键说明

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