|
||||||||||
| 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.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 MCardpublic void reverse(boolean reversed)
AbstractCard
reverse in class MCardreversed - if true the card will be tured as if your controled controls itpublic LastKnownCard createLastKnownCard()
LastKnownCardInfo
createLastKnownCard in interface LastKnownCardInfopublic Targetable getOriginalTargetable()
Targetable
getOriginalTargetable in class Targetablepublic boolean removeTimestamp(int timestamp)
removeTimestamp in interface LastKnownCardInfotimestamp - the timestamp reference
public boolean isSameState(int zoneConstaint)
MCardzoneConstaint is ID__ANYWHERE, return true. zoneConstaint is same as current zone of this card and
the constraint is validated, return true
isSameState in class MCardzoneConstaint - 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,
IdZonespublic boolean isSameIdZone(int idZone)
MCard
isSameIdZone in class MCardidZone - the other zone
public int getIdZone()
MCard
getIdZone in class MCardIdZones,
IdZonespublic void tap(boolean tapped)
Tappable
tap in interface Tappabletap in class MCardtapped - if true the component will be tapped
public void moveCard(int newIdPlace,
Player newController,
boolean newIsTapped,
int idPosition)
AbstractCard
moveCard in class MCardnewIdPlace - 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 MCardindex - the register index
public void addModifier(ColorModifier modifier)
MCard
addModifier in class MCardmodifier - the color-modifier to add to this objectpublic void addModifier(IdCardModifier modifier)
MCard
addModifier in class MCardmodifier - the idcard-modifier to add to this objectpublic void addModifier(PropertyModifier modifier)
MCard
addModifier in class MCardmodifier - the property-modifier to add to this objectpublic void addModifier(ControllerModifier modifier)
MCard
addModifier in class MCardmodifier - the controller-modifier to add to this objectpublic void addModifier(PlayableZoneModifier modifier)
MCard
addModifier in class MCardmodifier - the playable zone-modifier to add to this object
public void addModifier(RegisterModifier modifier,
int index)
Targetable
addModifier in class Targetablemodifier - the modifier to add to this objectindex - is the modifier register index
public void addModifier(RegisterIndirection modifier,
int index)
Targetable
addModifier in class Targetablemodifier - the indirection modifier to add to this objectindex - is the modifier register index
public void removeModifier(RegisterModifier modifier,
int index)
Targetable
removeModifier in class MCardmodifier - the register modifier to remove.index - index of register to remove.
public void removeModifier(RegisterIndirection indirection,
int index)
Targetable
removeModifier in class MCardindirection - the register-indirection modifier to remove.index - index of register indirection to remove.public void removeModifier(IdCardModifier modifier)
MCard
removeModifier in class MCardmodifier - the idcard-modifier to be removed from this objectpublic void removeModifier(ControllerModifier modifier)
MCard
removeModifier in class MCardmodifier - the controller-modifier to be removed from this objectpublic void removeModifier(PropertyModifier modifier)
MCard
removeModifier in class MCardmodifier - the property-modifier to be removed from this objectpublic void removeModifier(PlayableZoneModifier modifier)
MCard
removeModifier in class MCardmodifier - the playable zone-modifier to be removed from this objectpublic void removeModifier(ColorModifier modifier)
MCard
removeModifier in class MCardmodifier - the color-modifier to be removed from this object
public boolean playableZone(int supposedZone,
int idZone)
MCard
playableZone in class MCardsupposedZone - 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 MCardindex - 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 MCardposition - 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 | |||||||||