public class SnakeTableModel extends DefaultTableModel
columnIdentifiers, dataVectorlistenerList| Constructor and Description |
|---|
SnakeTableModel(MapSize size)
Construtor.
|
SnakeTableModel(MapSize mapSize,
boolean fill,
IMoveAlgorithm algorithm)
Construtor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getValueAt(int row,
int column) |
boolean |
isCellEditable(int row,
int column) |
void |
move()
Faz o movimento da cobra.
|
void |
setDirection(Direction direction)
Define a direção da cobra.
|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAtaddTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListenerpublic SnakeTableModel(MapSize mapSize, boolean fill, IMoveAlgorithm algorithm)
mapSize - tamanho do mapa.fill - flag que indica se é para preencher o mapa com os elementos do
jogo.algorithm - algoritmo de movimentação.public SnakeTableModel(MapSize size)
size - tamanho do mapa.public void setDirection(Direction direction)
direction - direção.public void move()
throws GameOverException,
VictoryException
GameOverException - em caso de suicídio ou bater na parede.VictoryException - em caso de zerar o jogo.public boolean isCellEditable(int row,
int column)
isCellEditable in interface TableModelisCellEditable in class DefaultTableModelpublic Object getValueAt(int row, int column)
getValueAt in interface TableModelgetValueAt in class DefaultTableModelCopyright © 2017 Tecgraf/PUC-Rio. All rights reserved.