|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
net.sf.magicproject.clickable.Clickable
net.sf.magicproject.clickable.targetable.Targetable
net.sf.magicproject.clickable.targetable.player.Player
public abstract class Player
Represents a player : name (avatar, preferences,...), mana and zones. Has
also a register like cards to store data as life, poison, maximal number of
cards in hand and number of cards to draw counter.
TODO support modifiers for player components, like cards.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary | |
|---|---|
javax.swing.JSplitPane |
handSplitter
The splitter of game/hand zones. |
int |
idPlayer
id of the player |
javax.swing.JPanel |
mainPanel
The panel containing the hand and the play |
ManaPool |
mana
is the manas of this player |
static int |
PLAYER_SIZE_HEIGHT
Player view height |
static int |
PLAYER_SIZE_WIDTH
Player view width |
PlayerCard |
playerCard
This card is used to represent this player as a card/ |
ZoneManager |
zoneManager
where all triggered abilities would go before to go to the stack |
| Fields inherited from class net.sf.magicproject.clickable.targetable.Targetable |
|---|
cachedAbilities, controllerModifier, indirections, registerModifiers, registers |
| Fields inherited from class net.sf.magicproject.clickable.Clickable |
|---|
highLightColor, isHighLighted |
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
|---|---|
void |
addTimestampReference()
Increment the reference counter for the current timestamp of this card. |
static void |
clickOn(java.io.InputStream input)
This method is invoked when opponent has clicked on this object. this call should be done from the net.sf.magicproject.network listener |
boolean |
declinePlay()
Indicates if this player decline to play any ability with an empty stack. |
boolean |
declineResponseMe()
Indicates if this player decline to response to the current effect. |
boolean |
declineResponseOpponent()
Indicates if this player decline to response to the current effect owned by opponent. |
void |
decrementTimestampReference(int timestamp)
Decrement the reference counter for the current timestamp of this card. |
void |
disHighLight()
Remove any color of the border |
Deck |
getDeck()
Return the current deck of player. |
int |
getId()
Return the id of this component. |
Targetable |
getLastKnownTargetable(int timeStamp)
Return this targetable as it was at the given timestamp. |
abstract java.lang.String |
getNickName()
Return the player's name. |
Player |
getOpponent()
Return the opponent player |
int |
getTimestamp()
Return the timstamp value of this targetable. |
int |
getValue(int index)
Return the value corresponding to the true register index. |
static void |
init()
Initialize the labels referencing to the registers of the MPlayer components. |
boolean |
isAbility()
Is this targetable is an abilty or a spell |
boolean |
isCard()
indicates if this target is a card |
boolean |
isCurrentPlayer()
tell if this player is the current one |
boolean |
isSpell()
Is this targetable is an abilty or a spell |
abstract boolean |
isYou()
tell if this player is you |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
|
boolean |
processHiddenTriggered()
Return true if there was one or several processed hidden triggered abilities |
void |
removeModifier(RegisterIndirection indirection,
int index)
Remove a register-indirection modifier from this component. |
void |
removeModifier(RegisterModifier modifier,
int index)
Remove a register modifier from this component. |
void |
reset(MPhase[] phases)
Remove, and then fill the phases of this player |
void |
sendClickToOpponent()
send to opponent the message indicating that we've clicked on this component |
void |
setActivePlayer()
Set this player as active one |
void |
setDeck(Deck deck)
Set the deck of this player. |
void |
setHandedPlayer()
Set this player as handed one |
void |
setValue(int index,
Operation operation,
int rightValue)
Set to the register of this card a value to a specified index. |
java.lang.String |
toString()
return the player's name |
static void |
unsetHandedPlayer()
Remove to all players the possibility to do something |
void |
update(java.awt.Graphics g)
|
abstract void |
updateReversed()
Update the opponent side depending on the "enable reverse" options. |
boolean |
waitTriggeredBufferChoice(boolean resolveOnEmpty)
Wait for the active player, then the non-active player to make choice of the order of triggered abilities to be put from the buffer to the stack |
| Methods inherited from class net.sf.magicproject.clickable.targetable.Targetable |
|---|
actionPerformed, addModifier, addModifier, addPrivateNamedObject, clearDamages, clearPrivateNamedObject, getCreator, getOriginalTargetable, getPrivateNamedObject, getPrivateNamedObjects, getValueIndirection, isPlayer, removePrivateNamedObject, setCreator, targetize, targetize, tokenize |
| Methods inherited from class net.sf.magicproject.clickable.Clickable |
|---|
disHighlight, highLight, mouseExited, mousePressed, mouseReleased |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PLAYER_SIZE_WIDTH
public static final int PLAYER_SIZE_HEIGHT
public ZoneManager zoneManager
public int idPlayer
public ManaPool mana
public PlayerCard playerCard
public javax.swing.JPanel mainPanel
public javax.swing.JSplitPane handSplitter
| Method Detail |
|---|
public abstract void updateReversed()
public void reset(MPhase[] phases)
phases - the phases to add.public boolean isCard()
Targetable
isCard in class Targetablepublic final boolean isAbility()
Targetable
isAbility in class Targetablepublic final boolean isSpell()
Targetable
isSpell in class Targetablepublic abstract boolean isYou()
public boolean isCurrentPlayer()
public Player getOpponent()
public void disHighLight()
Clickable
disHighLight in class Clickable
public void setValue(int index,
Operation operation,
int rightValue)
index - is the index of register to modifyoperation - the operation to userightValue - is the value to use as right operande for the operationpublic void update(java.awt.Graphics g)
update in class javax.swing.JComponentpublic static void init()
public java.lang.String toString()
toString in class Targetablepublic abstract java.lang.String getNickName()
public boolean declineResponseMe()
MPhase.declineResponseMe()public boolean declinePlay()
MPhase.breakpoint()public boolean declineResponseOpponent()
MPhase.declineResponseOpponent()public void setActivePlayer()
public void setHandedPlayer()
public static void unsetHandedPlayer()
public boolean waitTriggeredBufferChoice(boolean resolveOnEmpty)
resolveOnEmpty - if true, the stack resolution would be broken if no triggered
abilities have been played instead of playing the
WaitActivatedChoice action.
public boolean processHiddenTriggered()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenermouseClicked in class Clickable
public static void clickOn(java.io.InputStream input)
throws java.io.IOException
input - input stream of our net.sf.magicproject.network connection
java.io.IOException - if error occurred when reading the messagepublic void sendClickToOpponent()
Clickable
sendClickToOpponent in class Clickablepublic int getValue(int index)
Targetable
getValue in class Targetableindex - the register index
public int getTimestamp()
Targetable
getTimestamp in class Targetablepublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenermouseEntered in class Clickable
public void removeModifier(RegisterModifier modifier,
int index)
Targetable
removeModifier in class Targetablemodifier - the register modifier to remove.index - index of register to remove.
public void removeModifier(RegisterIndirection indirection,
int index)
Targetable
removeModifier in class Targetableindirection - the register-indirection modifier to remove.index - index of register indirection to remove.public Targetable getLastKnownTargetable(int timeStamp)
Targetable
getLastKnownTargetable in class TargetabletimeStamp - the timestamp number.
public void addTimestampReference()
addTimestampReference in class Targetablepublic void decrementTimestampReference(int timestamp)
Targetable
decrementTimestampReference in class Targetabletimestamp - is the reference to decrement.public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentpublic int getId()
Targetable
getId in class Targetablepublic void setDeck(Deck deck)
deck - the deck of this player.public Deck getDeck()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||