|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent net.sf.magicproject.clickable.Clickable net.sf.magicproject.clickable.targetable.Targetable net.sf.magicproject.clickable.targetable.card.AbstractCard net.sf.magicproject.clickable.targetable.card.MCard net.sf.magicproject.clickable.targetable.card.LastKnownCard
public class LastKnownCard
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 |
---|
Fields inherited from class net.sf.magicproject.clickable.targetable.card.MCard |
---|
abilityModifier, cachedIdCard, cachedIdColor, cachedProperties, cachedRegisters, colorModifier, idCardModifier, originalController, playableZoneModifier, propertyModifier, tapped |
Fields inherited from class net.sf.magicproject.clickable.targetable.card.AbstractCard |
---|
controller, reversed, visibility |
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 |
Constructor Summary | |
---|---|
LastKnownCard(MCard originalCard,
int destinationZone,
int idColor,
int idCard,
boolean tapped,
int[] registers,
Player controller,
Player owner,
java.util.Set<java.lang.Integer> properties,
int timestamp,
int timestampReferences)
|
Method Summary | |
---|---|
void |
addModifier(ColorModifier modifier)
Add a modifier to this object |
void |
addModifier(ControllerModifier modifier)
Add a modifier to this object |
void |
addModifier(IdCardModifier modifier)
Add a modifier to this object |
void |
addModifier(PlayableZoneModifier modifier)
Add a modifier to this object |
void |
addModifier(PropertyModifier modifier)
Add a modifier to this object |
void |
addModifier(RegisterIndirection modifier,
int index)
Add a modifier to this object |
void |
addModifier(RegisterModifier modifier,
int index)
Add a modifier to this object |
void |
addTimestampReference()
Add a reference to this targetable. |
LastKnownCard |
createLastKnownCard()
Create and return a LastKnownCard object build with the last known informations. |
int |
getIdZone()
Return the zone identifant of this card. |
Targetable |
getOriginalTargetable()
Return the original targetable without looking for the timestamp number. |
int |
getValue(int index)
Return the value corresponding to the true register index. |
boolean |
isSameIdZone(int idZone)
Compare a zone with the current card'szone |
boolean |
isSamePosition(int position)
Indicates wether this card suits to the specified position code. |
boolean |
isSameState(int zoneConstaint)
Indicates if this card match with the specified place and constraint. |
void |
moveCard(int newIdPlace,
Player newController,
boolean newIsTapped,
int idPosition)
Move this card to a new place tapped or not under the control of a player |
boolean |
playableZone(int supposedZone,
int idZone)
Indicates this card can be played from a specified zone. |
void |
removeModifier(ColorModifier modifier)
Remove the specified color-modifier. |
void |
removeModifier(ControllerModifier modifier)
Remove the specified controller-modifier |
void |
removeModifier(IdCardModifier modifier)
Remove the specified idcard-modifier |
void |
removeModifier(PlayableZoneModifier modifier)
Remove the specified playable zone-modifier |
void |
removeModifier(PropertyModifier modifier)
Remove the specified property-modifier |
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. |
boolean |
removeTimestamp(int timestamp)
Remove a reference to the given timestamp of card. |
void |
reverse(boolean reversed)
Reverse this card if the specified parameter is true |
void |
setValue(int index,
Operation operation,
int rightValue)
Set to the register of this card a value to a specified index. |
void |
tap(boolean tapped)
Tap/untap this component |
Methods inherited from class net.sf.magicproject.clickable.targetable.card.AbstractCard |
---|
getCardName, getController, getDatabase, getMUI, getPreviewImage, image, isCard, mouseEntered, mouseExited, notifyChange, reverseAsNeeded, scaledImage, toString |
Methods inherited from class net.sf.magicproject.clickable.targetable.Targetable |
---|
actionPerformed, addPrivateNamedObject, clearPrivateNamedObject, getCreator, getId, getPrivateNamedObject, getPrivateNamedObjects, isPlayer, removePrivateNamedObject, setCreator, targetize, tokenize |
Methods inherited from class net.sf.magicproject.clickable.Clickable |
---|
disHighLight, disHighlight, 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, paint, 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, update, 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 |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LastKnownCard(MCard originalCard, int destinationZone, int idColor, int idCard, boolean tapped, int[] registers, Player controller, Player owner, java.util.Set<java.lang.Integer> properties, int timestamp, int timestampReferences)
originalCard
- the original card reference.destinationZone
- destination id zone.idColor
- the original color id.idCard
- the original card type.tapped
- the original tapped position.registers
- the original registers.controller
- the original controller.owner
- the original owner.properties
- the original properties.timestamp
- the snapshot timestamp.timestampReferences
- the references to the cards.Method Detail |
---|
public void addTimestampReference()
Targetable
addTimestampReference
in class MCard
public void reverse(boolean reversed)
AbstractCard
reverse
in class MCard
reversed
- if true the card will be tured as if your controled controls itpublic LastKnownCard createLastKnownCard()
LastKnownCardInfo
createLastKnownCard
in interface LastKnownCardInfo
public Targetable getOriginalTargetable()
Targetable
getOriginalTargetable
in class Targetable
public boolean removeTimestamp(int timestamp)
removeTimestamp
in interface LastKnownCardInfo
timestamp
- the timestamp reference
public boolean isSameState(int zoneConstaint)
MCard
zoneConstaint
is ID__ANYWHERE, return true. zoneConstaint
is same as current zone of this card and
the constraint is validated, return true
isSameState
in class MCard
zoneConstaint
- the zone id and optional tapped information.
zoneConstaint
is ID__ANYWHERE or
zoneConstaint
is same as current place of this card
and the constraint is verified.IdZones.PLAY_TAPPED
,
IdZones.PLAY_UNTAPPED
,
IdZones
public boolean isSameIdZone(int idZone)
MCard
isSameIdZone
in class MCard
idZone
- the other zone
public int getIdZone()
MCard
getIdZone
in class MCard
IdZones
,
IdZones
public void tap(boolean tapped)
Tappable
tap
in interface Tappable
tap
in class MCard
tapped
- if true the component will be tappedpublic void moveCard(int newIdPlace, Player newController, boolean newIsTapped, int idPosition)
AbstractCard
moveCard
in class MCard
newIdPlace
- the new place for this cardnewController
- new controler of this card. If null, the controler is the owner.newIsTapped
- dertermines if this card will come tapped or notidPosition
- from IdPositionspublic int getValue(int index)
Targetable
getValue
in class MCard
index
- the register index
public void addModifier(ColorModifier modifier)
MCard
addModifier
in class MCard
modifier
- the color-modifier to add to this objectpublic void addModifier(IdCardModifier modifier)
MCard
addModifier
in class MCard
modifier
- the idcard-modifier to add to this objectpublic void addModifier(PropertyModifier modifier)
MCard
addModifier
in class MCard
modifier
- the property-modifier to add to this objectpublic void addModifier(ControllerModifier modifier)
MCard
addModifier
in class MCard
modifier
- the controller-modifier to add to this objectpublic void addModifier(PlayableZoneModifier modifier)
MCard
addModifier
in class MCard
modifier
- the playable zone-modifier to add to this objectpublic void addModifier(RegisterModifier modifier, int index)
Targetable
addModifier
in class Targetable
modifier
- the modifier to add to this objectindex
- is the modifier register indexpublic void addModifier(RegisterIndirection modifier, int index)
Targetable
addModifier
in class Targetable
modifier
- the indirection modifier to add to this objectindex
- is the modifier register indexpublic void removeModifier(RegisterModifier modifier, int index)
Targetable
removeModifier
in class MCard
modifier
- the register modifier to remove.index
- index of register to remove.public void removeModifier(RegisterIndirection indirection, int index)
Targetable
removeModifier
in class MCard
indirection
- the register-indirection modifier to remove.index
- index of register indirection to remove.public void removeModifier(IdCardModifier modifier)
MCard
removeModifier
in class MCard
modifier
- the idcard-modifier to be removed from this objectpublic void removeModifier(ControllerModifier modifier)
MCard
removeModifier
in class MCard
modifier
- the controller-modifier to be removed from this objectpublic void removeModifier(PropertyModifier modifier)
MCard
removeModifier
in class MCard
modifier
- the property-modifier to be removed from this objectpublic void removeModifier(PlayableZoneModifier modifier)
MCard
removeModifier
in class MCard
modifier
- the playable zone-modifier to be removed from this objectpublic void removeModifier(ColorModifier modifier)
MCard
removeModifier
in class MCard
modifier
- the color-modifier to be removed from this objectpublic boolean playableZone(int supposedZone, int idZone)
MCard
playableZone
in class MCard
supposedZone
- the zone where the this card would be played from.idZone
- the zone where this card can be played from.
public void setValue(int index, Operation operation, int rightValue)
MCard
setValue
in class MCard
index
- is the index of register to modifyoperation
- the operation to userightValue
- is the value to use as right operande for the operationpublic boolean isSamePosition(int position)
MCard
isSamePosition
in class MCard
position
- the matching position code
IdPositions.ON_THE_BOTTOM
,
IdPositions.ON_THE_TOP
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |