Manages the player bids for a trick taking card game such as spades. Changes to bids are sent
to the server and the data structure is only modified once the reply is received, at which time
a BidEvent is dispatched.
protected var _bids:NetArray
complete:Boolean [read-only]
Access whether or not all bids have been placed.
Implementation
public function get complete():Boolean
protected var _gameCtrl:GameControl
protected var _hasSelected:Boolean
hasSelected:Boolean [read-only]
Access whether or not a bid has been selected since the call to request a bid. This is
necessary for the auto-play feature to prevent a second bid from occurring while the first
one is propagating.
Implementation
public function get hasSelected():Boolean
length:int [read-only]
Access the number of bids placed so far.
Implementation
public function get length():int
protected var _maximum:int
maximum:int [read-only]
Access the maximum bid value.
Implementation
public function get maximum():int
players:Array [read-only]Implementation
protected function get players():Array
public function Bids(gameCtrl:GameControl, maximum:int) Create a new set of player bids.
Parameters
| gameCtrl:GameControl — the game control object used to set up the storage and communicate with
the server.
|
| |
| maximum:int — the maximum bid that the game rules will allow (the turn maximum is
typically lower and set in the request method) |
public function getBid(seat:int):int Get the bid for an absolute seating position.
Parameters
Returns
protected function handleElementChanged(event:ElementChangedEvent):voidParameters
| event:ElementChangedEvent |
protected function handlePropertyChanged(event:PropertyChangedEvent):voidParameters
| event:PropertyChangedEvent |
public function hasBid(seat:int):Boolean Check if the player in an absolute seating position has placed a bid yet.
Parameters
Returns
public function placeBid(value:int):void Send a bid request to the server on behalf of the local player. When the reply is received,
a BidEvent.PLACED event will be dispatched. If all bids are in, a BidEvent.COMPLETED event
will be sent.
Parameters
Throws
| — if the player has already bid. |
public function request(max:int):void Request a bid from the local player up to a specified maximum amount. This is not a network
event and immediately dispatches a BidEvent.REQUESTED event.
Parameters
public function reset():void Send a message to the server to clear all bids in preparation for the next round. When the
reply is received, a BidEvent.RESET event will be dispatched.
public function select(value:int):void Select the given bid on behalf of the local player. This is not a network event and
immediately sends a BidEvent.SELECTED event.
Parameters
protected static const ARRAYNAME:String = "bids"
protected static const NO_BID:int = -1