Revamped EZGame to work over the security boundary.
Now, instead of implementing "Game" and having the EZGame object assigned to you, you create it yourself using your top-level component. You must register listeners manually, and keyboard focus is currently an issue that I'm working on. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@137 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -6,9 +6,9 @@ package com.threerings.ezgame {
|
||||
*/
|
||||
public class CardDeck
|
||||
{
|
||||
public function CardDeck (gameObj :EZGame, deckName :String = "deck")
|
||||
public function CardDeck (gameCtrl :EZGameControl, deckName :String = "deck")
|
||||
{
|
||||
_gameObj = gameObj;
|
||||
_gameCtrl = gameCtrl;
|
||||
_deckName = deckName;
|
||||
|
||||
var deck :Array = new Array();
|
||||
@@ -19,23 +19,23 @@ public class CardDeck
|
||||
}
|
||||
}
|
||||
|
||||
_gameObj.setCollection(_deckName, deck);
|
||||
_gameCtrl.setCollection(_deckName, deck);
|
||||
}
|
||||
|
||||
public function dealToPlayer (
|
||||
playerIdx :int, count :int, msgName :String) :void
|
||||
{
|
||||
// TODO: support the callback
|
||||
_gameObj.dealFromCollection(_deckName, count, msgName, null, playerIdx);
|
||||
_gameCtrl.dealFromCollection(_deckName, count, msgName, null, playerIdx);
|
||||
}
|
||||
|
||||
public function dealToData (count :int, propName :String) :void
|
||||
{
|
||||
_gameObj.dealFromCollection(_deckName, count, propName, null);
|
||||
_gameCtrl.dealFromCollection(_deckName, count, propName, null);
|
||||
}
|
||||
|
||||
/** The game object. */
|
||||
protected var _gameObj :EZGame;
|
||||
/** The game control. */
|
||||
protected var _gameCtrl :EZGameControl;
|
||||
|
||||
/** The name of our deck. */
|
||||
protected var _deckName :String;
|
||||
|
||||
Reference in New Issue
Block a user