|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
this model is using to realise the DummyPuzzlePartList to create a game with no function.
This is needed to write this code in the PuzzlePanel:
partModel.doAnythingWithPart();
instead of:
if(part != null)
{
// do anything
}
for faster performance.
PuzzlePartList,
DummyPuzzlePartList,
PuzzlePanel| Method Summary | |
void |
deselectPart()
deselect the selected part if one selected |
PuzzlePartList.PuzzlePart |
getFirstNode()
return the first node |
PuzzlePartList.PuzzlePart[] |
getPartArray()
get the array with all parts, the array is never changing for a game, only the list is changing |
int |
getPartsCount()
return the puzzle part count |
int |
getSolvedPartsCount()
return the solved puzzle part count |
boolean |
isSelectedPart(PuzzlePartList.PuzzlePart part)
is the part the selected part or not |
void |
moveLocation(int dx,
int dy)
move the selected part |
boolean |
selectPart(java.awt.Point point)
select part at the point |
void |
setRedrawRect(java.awt.Rectangle repaintRect)
ask the model for the part that has changed and should be repainted |
void |
updatePart()
if the piece is releasing, test if it pass to another part and if true create a new part |
| Method Detail |
public int getPartsCount()
public int getSolvedPartsCount()
public PuzzlePartList.PuzzlePart getFirstNode()
public PuzzlePartList.PuzzlePart[] getPartArray()
public boolean isSelectedPart(PuzzlePartList.PuzzlePart part)
part - the part to comparepublic boolean selectPart(java.awt.Point point)
point - point for selectionpublic void deselectPart()
public void setRedrawRect(java.awt.Rectangle repaintRect)
repaintRect - reference to the Rectangle, that get the repaint rectangle
public void moveLocation(int dx,
int dy)
dx - new x positiondy - new y positionpublic void updatePart()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||