ted/model.go

31 lines
521 B
Go
Raw Permalink Normal View History

/**
* The model.
*/
package main
// An abstract model interface. At a minimum, models must be read only.
type Model interface {
2015-03-24 02:12:40 +00:00
// The dimensions of the model (height, width).
Dimensions() (int, int)
// Returns the value of a cell
CellValue(r, c int) string
2015-03-24 02:12:40 +00:00
}
// A read/write model.
type RWModel interface {
Model
// Resize the model.
Resize(newRow, newCol int)
// Sets the cell value
SetCellValue(r, c int, value string)
2015-03-24 02:12:40 +00:00
// Returns true if the model has been modified in some way
IsDirty() bool
}