BCESolve
|
Derived class for payoff table models. More...
#include <bcepayofftablemodel.hpp>
Public Member Functions | |
BCEPayoffTableModel (BCEGame *_game, int _state) | |
Constructor. | |
QVariant | data (const QModelIndex &index, int role) const Q_DECL_OVERRIDE |
Returns formatted data. More... | |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE |
Returns formatted header data. More... | |
bool | setData (const QModelIndex &index, const QVariant &value, int role) |
Sets data. More... | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const Q_DECL_OVERRIDE |
Returns the number of row player actions. | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const Q_DECL_OVERRIDE |
Returns the number of column player actions. | |
Public Member Functions inherited from BCETableModel | |
BCETableModel (BCEGame *_game, int _state) | |
Constructor. | |
Qt::ItemFlags | flags (const QModelIndex &index) const |
Returns flags. More... | |
void | emitLayoutChanged () |
Emits layoutChanged signal. | |
bool | setState (int newState) |
Sets the state to newState. | |
Additional Inherited Members | |
Protected Attributes inherited from BCETableModel | |
int | state |
The state that the model is associated with. | |
BCEGame * | game |
Pointer to the associated game. | |
Derived class for payoff table models.
This class handles the interface between BCETableView and the payoff matrices in BCEGame. Adds functionality for header data (using the row player action/ column player action conventions. Also reimplements the data() method to display comma separated entries for objective payoffs.
QVariant BCEPayoffTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Returns formatted data.
Returns comma separated entries of objective payoffs for the action profile specified in index. Reads this data from the game object using BCEGame::objective.
QVariant BCEPayoffTableModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
Returns formatted header data.
Returns header data formatted to indicate the appropriate row/ column action.
bool BCEPayoffTableModel::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role | ||
) |
Sets data.
Parses the data in value to set new payoffs for the objective. Sets the data using BCEGame::setObjective.