📄 grid.h
字号:
template <typename T, int WIDTH, int HEIGHT>class Grid{ public: void setElementAt(int x, int y, const T& inElem); T& getElementAt(int x, int y); const T& getElementAt(int x, int y) const; int getHeight() const { return HEIGHT; } int getWidth() const { return WIDTH; } protected: T mCells[WIDTH][HEIGHT];};template <typename T, int WIDTH, int HEIGHT>void Grid<T, WIDTH, HEIGHT>::setElementAt(int x, int y, const T& inElem){ mCells[x][y] = inElem;}template <typename T, int WIDTH, int HEIGHT>T& Grid<T, WIDTH, HEIGHT>::getElementAt(int x, int y){ return (mCells[x][y]);}template <typename T, int WIDTH, int HEIGHT>const T& Grid<T, WIDTH, HEIGHT>::getElementAt(int x, int y) const{ return (mCells[x][y]);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -