Package | com.whirled.game |
Class | public class BagsSubControl |
Inheritance | BagsSubControl ![]() ![]() ![]() |
Method | Defined by | ||
---|---|---|---|
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
| AbstractControl | |
addTo(bagName:String, values:Array):void
Add values to an existing bag.
| BagsSubControl | ||
create(bagName:String, values:Array):void
Create a bag containing the specified values, clearing any previous bag with the same name.
| BagsSubControl | ||
deal(bagName:String, count:int, msgOrPropName:String, callback:Function = null, playerId:int):void
Deal (remove) the specified number of elements from a bag, and distribute them to a
specific player or set them as a property in the game data.
| BagsSubControl | ||
![]() |
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server
together.
| AbstractSubControl | |
![]() |
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just
loaded up our SWF by itself?
| AbstractSubControl | |
merge(srcBag:String, intoBag:String):void
Merge all values from the specified bag into the other bag.
| BagsSubControl | ||
pick(bagName:String, count:int, msgOrPropName:String, playerId:int):void
Pick (do not remove) the specified number of elements from a bag, and distribute them to a
specific player or set them as a property in the game data.
| BagsSubControl | ||
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
| AbstractControl |
Constant | Defined by | ||
---|---|---|---|
SHOW_TO_ALL : int = 0 [static]
Player id constant used by
pick and deal indicating that elements
should be picked or dealt publicly to all players. | BagsSubControl |
addTo | () | method |
public function addTo(bagName:String, values:Array):void
Add values to an existing bag. If it doesn't exist, it will be created.
ParametersbagName:String |
|
values:Array |
create | () | method |
public function create(bagName:String, values:Array):void
Create a bag containing the specified values, clearing any previous bag with the same name.
ParametersbagName:String |
|
values:Array |
deal | () | method |
public function deal(bagName:String, count:int, msgOrPropName:String, callback:Function = null, playerId:int):void
Deal (remove) the specified number of elements from a bag, and distribute them to a specific player or set them as a property in the game data. Fails if the named collection could not be found or does not contain enough elements to complete the deal.
ParametersbagName:String — the collection name.
|
|
count:int — the number of elements to pick
|
|
msgOrPropName:String — the name of the message or property that will contain the picked
elements.
|
|
callback:Function (default = null ) — optional function to call after the deal has completed. If provided, the
signature of the function must be compatible with the following:
function onDealt (count :int) :void {} |
|
playerId:int — if SHOW_TO_ALL (or unset), the picked elements should be set on
the gameObject as a property for all to see. If a playerId is specified, only that player
will receive the elements as a message.
|
See also
merge | () | method |
public function merge(srcBag:String, intoBag:String):void
Merge all values from the specified bag into the other bag. The source bag will be destroyed. The elements from the source bag will be shuffled and appended to the end of the destination bag.
ParameterssrcBag:String |
|
intoBag:String |
pick | () | method |
public function pick(bagName:String, count:int, msgOrPropName:String, playerId:int):void
Pick (do not remove) the specified number of elements from a bag, and distribute them to a specific player or set them as a property in the game data.
ParametersbagName:String — the collection name.
|
|
count:int — the number of elements to pick
|
|
msgOrPropName:String — the name of the message or property that will contain the picked
elements.
|
|
playerId:int — if SHOW_TO_ALL (or unset), the picked elements should be set on
the gameObject as a property for all to see. If a playerId is specified, only that player
will receive the elements as a message.
|
See also
SHOW_TO_ALL | constant |
public static const SHOW_TO_ALL:int = 0
Player id constant used by pick
and deal
indicating that elements
should be picked or dealt publicly to all players.
See also