diff --git a/src/as/com/threerings/parlor/game/client/GameController.as b/src/as/com/threerings/parlor/game/client/GameController.as index 46f0711d..a1b024d2 100644 --- a/src/as/com/threerings/parlor/game/client/GameController.as +++ b/src/as/com/threerings/parlor/game/client/GameController.as @@ -30,10 +30,10 @@ import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.util.CrowdContext; -import com.threerings.parlor.Log; import com.threerings.parlor.game.data.GameCodes; import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameObject; +import com.threerings.parlor.game.data.PartyGameCodes; import com.threerings.parlor.game.data.PartyGameConfig; import com.threerings.parlor.util.ParlorContext; @@ -69,7 +69,7 @@ public /*abstract*/ class GameController extends PlaceController // super.init() calls createPlaceView(), we have our casted // references already in place _ctx = (ctx as ParlorContext); - _config = (config as GameConfig); + _gconfig = (config as GameConfig); super.init(ctx, config); } @@ -195,7 +195,7 @@ public /*abstract*/ class GameController extends PlaceController { // deal with game state changes var name :String = event.getName(); - if (GameObject.STATE.equals(name)) { + if (GameObject.STATE == name) { var newState :int = int(event.getValue()); if (!stateDidChange(newState)) { log.warning("Game transitioned to unknown state " + @@ -314,16 +314,16 @@ public /*abstract*/ class GameController extends PlaceController */ protected function isPartyGame () :Boolean { - return (_config is PartyGameConfig) && - (PartyGameConfig(_config).getPartyGameType() != - PartyGameConfig.NOT_PARTY_GAME); + return (_gconfig is PartyGameConfig) && + (PartyGameConfig(_gconfig).getPartyGameType() != + PartyGameCodes.NOT_PARTY_GAME); } /** A reference to the active parlor context. */ protected var _pctx :ParlorContext; /** Our game configuration information. */ - protected var _config :GameConfig; + protected var _gconfig :GameConfig; /** A reference to the game object for the game that we're * controlling. */ diff --git a/src/as/com/threerings/parlor/game/data/GameObject.as b/src/as/com/threerings/parlor/game/data/GameObject.as index 400f0815..13cbd6e4 100644 --- a/src/as/com/threerings/parlor/game/data/GameObject.as +++ b/src/as/com/threerings/parlor/game/data/GameObject.as @@ -21,9 +21,11 @@ package com.threerings.parlor.game.data { +import com.threerings.util.ArrayUtil; import com.threerings.util.Integer; import com.threerings.util.langBoolean; import com.threerings.util.Name; +import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; @@ -200,7 +202,7 @@ public class GameObject extends PlaceObject */ public function getWinnerCount () :int { - int count = 0; + var count :int = 0; if (winners != null) { for (var ii :int = 0; ii < winners.length; ii++) { if (winners[ii]) { @@ -236,7 +238,7 @@ public class GameObject extends PlaceObject */ public function getPartyGameType () :int { - return PartyGameConfig.NOT_PARTY_GAME; + return PartyGameCodes.NOT_PARTY_GAME; } /** diff --git a/src/as/com/threerings/parlor/game/data/PartyGameCodes.as b/src/as/com/threerings/parlor/game/data/PartyGameCodes.as new file mode 100644 index 00000000..bf9ce50d --- /dev/null +++ b/src/as/com/threerings/parlor/game/data/PartyGameCodes.as @@ -0,0 +1,19 @@ +package com.threerings.parlor.game.data { + +public class PartyGameCodes +{ + /** Party game constant indicating that this game, while it does + * implement PartyGameConfig, is not currently being played in party + * mode. */ + public static const NOT_PARTY_GAME :int = 0; + + /** Party game constant indicating that we're in a party game in which + * players must sit at an available seat to play, otherwise they're + * an observer. */ + public static const SEATED_PARTY_GAME :int = 1; + + /** Party game constant indicating that everyone in the game place is + * a "player", meaning that they do not need to claim a seat to play. */ + public static const FREE_FOR_ALL_PARTY_GAME :int = 2; +} +} diff --git a/src/as/com/threerings/parlor/game/data/PartyGameConfig.as b/src/as/com/threerings/parlor/game/data/PartyGameConfig.as index f678d3a3..e60c4df4 100644 --- a/src/as/com/threerings/parlor/game/data/PartyGameConfig.as +++ b/src/as/com/threerings/parlor/game/data/PartyGameConfig.as @@ -29,20 +29,6 @@ package com.threerings.parlor.game.data { */ public interface PartyGameConfig { - /** Party game constant indicating that this game, while it does - * implement PartyGameConfig, is not currently being played in party - * mode. */ - public static const NOT_PARTY_GAME :int = 0; - - /** Party game constant indicating that we're in a party game in which - * players must sit at an available seat to play, otherwise they're - * an observer. */ - public static const SEATED_PARTY_GAME :int = 1; - - /** Party game constant indicating that everyone in the game place is - * a "player", meaning that they do not need to claim a seat to play. */ - public static const FREE_FOR_ALL_PARTY_GAME :int = 2; - /** * Get the type of party game being played. */