Packagecom.whirled.contrib.card
Classpublic class HandEvent
InheritanceHandEvent Inheritance flash.events.Event

Represents something that happens to a hand of cards.



Public Properties
 PropertyDefined by
  cards : CardArray
[read-only] The cards that have been dealt or passed.
HandEvent
  count : int
[read-only] The number of cards requested to be passed.
HandEvent
  player : int
[read-only] The player that passed or requested to pass the cards.
HandEvent
  targetPlayer : int
[read-only] The player that is being passed to.
HandEvent
Protected Properties
 PropertyDefined by
  _cards : CardArray
HandEvent
  _count : int
HandEvent
  _player : int
HandEvent
  _targetPlayer : int
HandEvent
Public Methods
 MethodDefined by
  
HandEvent(type:String, cards:CardArray = null, player:int = 0, count:int = 0, targetPlayer:int = 0)
Create a new HandEvent.
HandEvent
  
clone():Event
HandEvent
  
toString():String
HandEvent
Public Constants
 ConstantDefined by
  ALLOWED_PLAY : String = "hand.allowedPlay"
[static] The type of event when it is the player's turn.
HandEvent
  ALLOWED_SELECTION : String = "hand.allowedSelection"
[static] The type of event when the local player may choose some cards, but not yet play them's turn.
HandEvent
  CARDS_PLAYED : String = "hand.played"
[static] The type of event sent when cards have been selected for play.
HandEvent
  DEALT : String = "hand.dealt"
[static] The type of event when the hand is dealt.
HandEvent
  DISALLOWED_SELECTION : String = "hand.disallowedSelection"
[static] The type of event sent when the local player can no longer select or play any cards.
HandEvent
  PASSED : String = "hand.passed"
[static] The type of event when cards are passed to the hand from another player.
HandEvent
  PASS_REQUESTED : String = "hand.requested"
[static] The type of event when the rules of the game require the local player to pass cards.
HandEvent
Property detail
_cardsproperty
protected var _cards:CardArray
cardsproperty 
cards:CardArray  [read-only]

The cards that have been dealt or passed.

Implementation
    public function get cards():CardArray
_countproperty 
protected var _count:int
countproperty 
count:int  [read-only]

The number of cards requested to be passed.

Implementation
    public function get count():int
_playerproperty 
protected var _player:int
playerproperty 
player:int  [read-only]

The player that passed or requested to pass the cards.

Implementation
    public function get player():int
_targetPlayerproperty 
protected var _targetPlayer:int
targetPlayerproperty 
targetPlayer:int  [read-only]

The player that is being passed to.

Implementation
    public function get targetPlayer():int
Constructor detail
HandEvent()constructor
public function HandEvent(type:String, cards:CardArray = null, player:int = 0, count:int = 0, targetPlayer:int = 0)

Create a new HandEvent.

Parameters
type:String
 
cards:CardArray (default = null)
 
player:int (default = 0)
 
count:int (default = 0)
 
targetPlayer:int (default = 0)
Method detail
clone()method
public override function clone():Event

Returns
Event
toString()method 
public override function toString():String

Returns
String
Constant detail
ALLOWED_PLAYconstant
public static const ALLOWED_PLAY:String = "hand.allowedPlay"

The type of event when it is the player's turn. For this event, the cards property is set to the set of cards that are allowed according to the game rules and the count property is set to the number of cards that should be played. The player and targetPlayer properties are not used.

ALLOWED_SELECTIONconstant 
public static const ALLOWED_SELECTION:String = "hand.allowedSelection"

The type of event when the local player may choose some cards, but not yet play them's turn. For this event, the cards property is set to the set of cards that are allowed to be selected (according to the game rules or game presentation) and the count property is set to the number of cards that may be selected. The player and targetPlayer properties are not used.

CARDS_PLAYEDconstant 
public static const CARDS_PLAYED:String = "hand.played"

The type of event sent when cards have been selected for play. For this event, the cards property indicates the selected ones and the other properties are not used.

DEALTconstant 
public static const DEALT:String = "hand.dealt"

The type of event when the hand is dealt. For this event, the cards property is the new contents of the hand and the player, count and targetPlayer properties are not used.

DISALLOWED_SELECTIONconstant 
public static const DISALLOWED_SELECTION:String = "hand.disallowedSelection"

The type of event sent when the local player can no longer select or play any cards. For this event, no properties are used.

PASSEDconstant 
public static const PASSED:String = "hand.passed"

The type of event when cards are passed to the hand from another player. For this event, the cards property is the passed cards (if available), the player is the id of the player who has passed them, the count property is the number of cards passed and the targetPlayer is the id of the player receiving the passed cards.

PASS_REQUESTEDconstant 
public static const PASS_REQUESTED:String = "hand.requested"

The type of event when the rules of the game require the local player to pass cards. For this event type, the cards property is not used, the player property is the id of the player who is required to pass, the count property is the number of cards that should be passed and the targetPlayer is the player who will receive the passed cards.