initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <QPoint>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
// Equivalent of StringTable.pas's TStringTable: a resizable 2D string grid.
|
||||
class StringTable {
|
||||
public:
|
||||
QString cell(int x, int y) const { return m_cells.at(y).at(x); }
|
||||
void setCell(int x, int y, const QString &value) { m_cells[y][x] = value; }
|
||||
|
||||
int colCount() const { return m_size.x(); }
|
||||
void setColCount(int value) { setSize(QPoint(value, rowCount())); }
|
||||
int rowCount() const { return m_size.y(); }
|
||||
void setRowCount(int value) { setSize(QPoint(colCount(), value)); }
|
||||
|
||||
QPoint size() const { return m_size; }
|
||||
void setSize(QPoint value);
|
||||
|
||||
private:
|
||||
QVector<QVector<QString>> m_cells;
|
||||
QPoint m_size;
|
||||
};
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user