public interface PositioningStrategy<LOCATION>
Modifier and Type | Method and Description |
---|---|
java.awt.Point |
calculateFigureCoordinatesForProps(java.lang.String keyOfProp)
Calculate proper coordinates for a prop (non-movable BoardFigure) based upon
its key (unique string identifier).
|
java.awt.Point |
calculateFigureCoordinatesIndexedForLocation(LOCATION location,
int index)
Calculate proper graphical (x,y) coordinates of a figure that has been
moved to a given location on the board.
|
java.awt.Point calculateFigureCoordinatesIndexedForLocation(LOCATION location, int index)
location
- the location to which the figure has been movedindex
- the offset of this figure on the location. For games that only
allow one piece/figure per location, this index is always 0. For
games with multiple pieces on a location, it indicates which of
the pieces MiniDraw wants new coordinates for. E.g. in backgammon
if index = 1 then it is the second checker on that location that
is requested coordinates for.java.awt.Point calculateFigureCoordinatesForProps(java.lang.String keyOfProp)
keyOfProp
- the key of the propFrom the book: Flexible, Reliable Software, © CRC Press 2010. Author: Henrik B. Christensen, Aarhus University, Denmark