Packagecom.whirled.contrib.card.graphics
Classpublic class MainTrickSprite
InheritanceMainTrickSprite Inheritance TrickSprite Inheritance CardArraySprite Inheritance flash.display.Sprite

Graphic for the cards in the main trick (in the center of the table). Supports animation from the local and remote players.



Public Properties
 PropertyDefined by
 Inheritedfactory : CardSpriteFactory
Access the factory for card creation and layout.
CardArraySprite
Protected Properties
 PropertyDefined by
 Inherited_animations : Array
CardArraySprite
 Inherited_cards : Array
CardArraySprite
 Inherited_factory : CardSpriteFactory
CardArraySprite
  _localHand : HandSprite
MainTrickSprite
  _playerSprites : Array
MainTrickSprite
 Inherited_seating : Table
TrickSprite
 Inherited_target : CardArray
CardArraySprite
 Inherited_trick : Trick
TrickSprite
 Inherited_winningCard : int = -1
TrickSprite
 InheritedwinningCard : int
Access the card that is currently winning, relative to the first card played this round.
TrickSprite
Public Methods
 MethodDefined by
  
MainTrickSprite(target:Trick, seating:Table, playerSprites:Array, localHand:HandSprite)
Creates a new main trick sprite.
MainTrickSprite
  
orphanCards():Array
Remove all the card sprites and return an array containing them.
MainTrickSprite
Protected Methods
 MethodDefined by
  
inheritDoc
MainTrickSprite
 Inherited
Animates the removal of a card.
CardArraySprite
 Inherited
When the card array changes, update our child sprites and re-layout.
CardArraySprite
 Inherited
getStaticCardPosition(index:int, pos:Point):void
Use the static proportional positions and the current trick leader to place the cards in a cross, mimicking the player positions at the table.
TrickSprite
 Inherited
Positions all cards (that are not currently animating).
CardArraySprite
 Inherited
refresh():void
Update our card sprites with the contents of the target card array.
CardArraySprite
 Inherited
TrickSprite
Protected Constants
 ConstantDefined by
 InheritedCARD_POSITIONS : Array
[static]
TrickSprite
  FLY_IN_DURATION : Number = .75
[static]
MainTrickSprite
Property detail
_localHandproperty
protected var _localHand:HandSprite
_playerSpritesproperty 
protected var _playerSprites:Array
Constructor detail
MainTrickSprite()constructor
public function MainTrickSprite(target:Trick, seating:Table, playerSprites:Array, localHand:HandSprite)

Creates a new main trick sprite.

Parameters
target:Trick — The trick that this sprite represents
 
seating:Table — An array of player sprite, relative to the local player
 
playerSprites:Array — The sprite representing the local player's hand
 
localHand:HandSprite
Method detail
animateAddition()method
protected override function animateAddition(card:CardSprite):void

inheritDoc

Parameters
card:CardSprite
orphanCards()method 
public function orphanCards():Array

Remove all the card sprites and return an array containing them. This should only be called if the underlying trick is about to be reset, i.e. on a CardArrayEvent.ACTION_PRERESET action. Otherwise a crash will occur. TODO: handle this using internal listener so caveat is not needed.

Returns
Array
Constant detail
FLY_IN_DURATIONconstant
protected static const FLY_IN_DURATION:Number = .75