E
- Entity type used.public abstract class ControlPanelModel<E extends EntityRts> extends java.lang.Object implements ControlPanelListener
Constructor and Description |
---|
ControlPanelModel()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(ControlPanelListener listener)
Add a control panel listener.
|
boolean |
canClick(CursorRts cursor)
Check if cursor can click on panel.
|
com.b3dgs.lionengine.Rectangle |
getArea()
Get clickable area on map (out panel).
|
boolean |
isOrdered()
Check if panel is in ordered mode (waiting for a second click).
|
boolean |
isSelecting()
Check if panel is in selection mode.
|
void |
notifySelectionDone(com.b3dgs.lionengine.Rectangle selection)
Notify when selection is done.
|
void |
notifySelectionStarted(com.b3dgs.lionengine.Rectangle selection)
Notify when selection started.
|
abstract void |
notifyUpdatedSelection(java.util.Set<E> selection)
Called when the selection has been updated by the handler.
|
void |
ordered()
Set the ordered state (when an action skill is chosen).
|
void |
removeListener(ControlPanelListener listener)
Add a control panel listener.
|
void |
renderCursorSelection(com.b3dgs.lionengine.Graphic g,
CameraRts camera)
Render cursor selection routine.
|
void |
resetOrder()
Reset order state (order failed).
|
void |
setClickableArea(com.b3dgs.lionengine.game.CameraGame camera)
Set clickable area on map (not on panel), depending of the camera view.
|
void |
setClickableArea(com.b3dgs.lionengine.Rectangle area)
Set clickable area on map (not on panel).
|
void |
setClickSelection(int click)
Set the mouse click selection value.
|
void |
setPlayer(PlayerRts player)
Set player (player owning this panel).
|
void |
setSelectionColor(com.b3dgs.lionengine.ColorRgba color)
Set the selection color.
|
void |
update(double extrp,
CameraRts camera,
CursorRts cursor,
com.b3dgs.lionengine.Keyboard keyboard)
Update panel routine.
|
public abstract void notifyUpdatedSelection(java.util.Set<E> selection)
selection
- The selected entities.public void addListener(ControlPanelListener listener)
listener
- The listener.public void removeListener(ControlPanelListener listener)
listener
- The listener.public void update(double extrp, CameraRts camera, CursorRts cursor, com.b3dgs.lionengine.Keyboard keyboard)
extrp
- The extrapolation value.camera
- The camera viewpoint.cursor
- The cursor reference (used for selection).keyboard
- The keyboard reference.public void renderCursorSelection(com.b3dgs.lionengine.Graphic g, CameraRts camera)
g
- The graphic output.camera
- The camera reference.public void resetOrder()
public void setClickSelection(int click)
click
- The click id.public void setClickableArea(com.b3dgs.lionengine.Rectangle area)
area
- The area representing the clickable area.public void setClickableArea(com.b3dgs.lionengine.game.CameraGame camera)
camera
- The camera reference.public void setPlayer(PlayerRts player)
player
- The player reference.public void setSelectionColor(com.b3dgs.lionengine.ColorRgba color)
color
- The selection color.public com.b3dgs.lionengine.Rectangle getArea()
public boolean canClick(CursorRts cursor)
cursor
- The cursor reference.true
if can click on panel, false
else.public void ordered()
public boolean isOrdered()
true
if ordering, false
else.public boolean isSelecting()
true
if selecting, false
else.public void notifySelectionStarted(com.b3dgs.lionengine.Rectangle selection)
ControlPanelListener
notifySelectionStarted
in interface ControlPanelListener
selection
- The selection.public void notifySelectionDone(com.b3dgs.lionengine.Rectangle selection)
ControlPanelListener
notifySelectionDone
in interface ControlPanelListener
selection
- The selection.