diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/client/AtlantiController.java b/projects/atlanti/src/java/com/samskivert/atlanti/client/AtlantiController.java index 94a0fc84..4bf6e70e 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/client/AtlantiController.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/client/AtlantiController.java @@ -5,6 +5,7 @@ package com.samskivert.atlanti.client; import java.awt.event.ActionEvent; import com.samskivert.util.ListUtil; +import com.threerings.util.Name; import com.threerings.presents.dobj.AttributeChangedEvent; import com.threerings.presents.dobj.DSet; @@ -90,7 +91,7 @@ public class AtlantiController extends GameController } // documentation inherited - public void turnDidChange (String turnHolder) + public void turnDidChange (Name turnHolder) { // if it's our turn, set the tile to be placed if (turnHolder.equals(_self.username)) { diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/client/PlayerInfoView.java b/projects/atlanti/src/java/com/samskivert/atlanti/client/PlayerInfoView.java index 97510407..84250460 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/client/PlayerInfoView.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/client/PlayerInfoView.java @@ -10,6 +10,8 @@ import java.awt.GridBagConstraints; import javax.swing.JLabel; import javax.swing.JPanel; +import com.threerings.util.Name; + import com.threerings.presents.dobj.AttributeChangeListener; import com.threerings.presents.dobj.AttributeChangedEvent; import com.threerings.presents.dobj.SetListener; @@ -74,14 +76,14 @@ public class PlayerInfoView /** * Adds a player to the display. */ - protected void addPlayer (int idx, String username) + protected void addPlayer (int idx, Name username) { GridBagConstraints c = new GridBagConstraints(); // create a label for their username c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; // use up extra space on this label - JLabel unlabel = new JLabel(username); + JLabel unlabel = new JLabel(username.toString()); unlabel.setForeground(Feature.PIECEN_COLOR_MAP[idx]); add(unlabel, c); diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/client/TurnIndicatorView.java b/projects/atlanti/src/java/com/samskivert/atlanti/client/TurnIndicatorView.java index 5b059a11..83cb71c1 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/client/TurnIndicatorView.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/client/TurnIndicatorView.java @@ -110,7 +110,7 @@ public class TurnIndicatorView extends JPanel protected void updateTurnHolder () { if (_atlobj.state == AtlantiObject.IN_PLAY) { - _whoLabel.setText(_atlobj.turnHolder); + _whoLabel.setText(_atlobj.turnHolder.toString()); } } diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.dobj b/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.dobj index 09189550..106a2104 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.dobj +++ b/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.dobj @@ -4,6 +4,7 @@ package com.samskivert.atlanti.data; import com.threerings.presents.dobj.DSet; +import com.threerings.util.Name; import com.threerings.parlor.game.GameObject; import com.threerings.parlor.turn.TurnGameObject; @@ -15,7 +16,7 @@ public class AtlantiObject extends GameObject implements TurnGameObject { /** The username of the current turn holder. */ - public String turnHolder; + public Name turnHolder; /** A set containing all of the tiles that are in play in this * game. */ @@ -33,7 +34,7 @@ public class AtlantiObject extends GameObject public int[] scores; // documentation inherited from interface - public String[] getPlayers () + public Name[] getPlayers () { return players; } @@ -45,7 +46,7 @@ public class AtlantiObject extends GameObject } // documentation inherited from interface - public String getTurnHolder () + public Name getTurnHolder () { return turnHolder; } diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.java b/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.java index e5fdc1c4..eff24e14 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiObject.java @@ -4,6 +4,7 @@ package com.samskivert.atlanti.data; import com.threerings.presents.dobj.DSet; +import com.threerings.util.Name; import com.threerings.parlor.game.GameObject; import com.threerings.parlor.turn.TurnGameObject; @@ -30,7 +31,7 @@ public class AtlantiObject extends GameObject public static final String SCORES = "scores"; /** The username of the current turn holder. */ - public String turnHolder; + public Name turnHolder; /** A set containing all of the tiles that are in play in this * game. */ @@ -48,7 +49,7 @@ public class AtlantiObject extends GameObject public int[] scores; // documentation inherited from interface - public String[] getPlayers () + public Name[] getPlayers () { return players; } @@ -60,7 +61,7 @@ public class AtlantiObject extends GameObject } // documentation inherited from interface - public String getTurnHolder () + public Name getTurnHolder () { return turnHolder; } @@ -73,10 +74,10 @@ public class AtlantiObject extends GameObject * clients) will apply the value change when they received the * attribute changed notification. */ - public void setTurnHolder (String turnHolder) + public void setTurnHolder (Name turnHolder) { - this.turnHolder = turnHolder; requestAttributeChange(TURN_HOLDER, turnHolder); + this.turnHolder = turnHolder; } /** @@ -121,8 +122,8 @@ public class AtlantiObject extends GameObject */ public void setTiles (DSet tiles) { - this.tiles = tiles; requestAttributeChange(TILES, tiles); + this.tiles = tiles; } /** @@ -135,8 +136,8 @@ public class AtlantiObject extends GameObject */ public void setCurrentTile (AtlantiTile currentTile) { - this.currentTile = currentTile; requestAttributeChange(CURRENT_TILE, currentTile); + this.currentTile = currentTile; } /** @@ -181,8 +182,8 @@ public class AtlantiObject extends GameObject */ public void setPiecens (DSet piecens) { - this.piecens = piecens; requestAttributeChange(PIECENS, piecens); + this.piecens = piecens; } /** @@ -195,8 +196,8 @@ public class AtlantiObject extends GameObject */ public void setScores (int[] scores) { - this.scores = scores; requestAttributeChange(SCORES, scores); + this.scores = scores; } /** @@ -209,7 +210,7 @@ public class AtlantiObject extends GameObject */ public void setScoresAt (int value, int index) { - this.scores[index] = value; requestElementUpdate(SCORES, new Integer(value), index); + this.scores[index] = value; } } diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiTile.java b/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiTile.java index 68b36c0f..4aa3412e 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiTile.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/data/AtlantiTile.java @@ -464,12 +464,12 @@ public class AtlantiTile { // load up the tile set if we haven't already if (_tset == null) { - _tset = _tmgr.loadTileSet(TILES_IMG_PATH, TILE_TYPES, + _tset = _tmgr.loadTileSet(TILES_IMG_PATH, TILE_WIDTH, TILE_HEIGHT); } // fetch the tile - return _tset.getTileImage(type-1); + return _tset.getRawTileImage(type-1); } /** @@ -479,12 +479,12 @@ public class AtlantiTile { // load up the tile set if we haven't already if (_stset == null) { - _stset = _tmgr.loadTileSet(SHIELD_IMG_PATH, 1, + _stset = _tmgr.loadTileSet(SHIELD_IMG_PATH, SHIELD_SIZE, SHIELD_SIZE); } // fetch the tile - return _stset.getTileImage(0); + return _stset.getRawTileImage(0); } /** The tile image that we use to render this tile. */ diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/server/AtlantiManager.java b/projects/atlanti/src/java/com/samskivert/atlanti/server/AtlantiManager.java index 050bb512..040821e9 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/server/AtlantiManager.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/server/AtlantiManager.java @@ -21,10 +21,9 @@ import com.threerings.presents.dobj.MessageEvent; import com.threerings.presents.dobj.MessageEvent; -import com.threerings.crowd.chat.ChatProvider; -import com.threerings.crowd.chat.SpeakProvider; +import com.threerings.crowd.chat.server.ChatProvider; +import com.threerings.crowd.chat.server.SpeakProvider; import com.threerings.crowd.data.PlaceObject; - import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.server.PlaceManager; @@ -248,7 +247,7 @@ public class AtlantiManager extends GameManager String message = qual + " " + TileCodes.FEATURE_NAMES[f.type] + " scored " + score + " points for " + names + "."; - SpeakProvider.sendSystemSpeak( + SpeakProvider.sendInfo( _atlobj, ATLANTI_MESSAGE_BUNDLE, message); Log.info("New scores: " + StringUtil.toString(_atlobj.scores)); @@ -321,7 +320,7 @@ public class AtlantiManager extends GameManager // players about the score String message = getPlayerName(p.owner) + " scored " + score + " points for " + qual + " temple."; - SpeakProvider.sendSystemSpeak( + SpeakProvider.sendInfo( _atlobj, ATLANTI_MESSAGE_BUNDLE, message); // add the score to the owning player @@ -469,7 +468,7 @@ public class AtlantiManager extends GameManager _atlobj.scores[i] += cityScores[i]; String message = getPlayerName(i) + " scores " + cityScores[i] + " points for fisheries."; - SpeakProvider.sendSystemSpeak( + SpeakProvider.sendInfo( _atlobj, ATLANTI_MESSAGE_BUNDLE, message); } } diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/util/PiecenUtil.java b/projects/atlanti/src/java/com/samskivert/atlanti/util/PiecenUtil.java index 4420bd29..b1a29f46 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/util/PiecenUtil.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/util/PiecenUtil.java @@ -17,10 +17,10 @@ public class PiecenUtil public static void init (TileManager tmgr) { UniformTileSet piecenSet = tmgr.loadTileSet( - PIECEN_IMG_PATH, PIECEN_TYPES, PIECEN_WIDTH, PIECEN_HEIGHT); + PIECEN_IMG_PATH, PIECEN_WIDTH, PIECEN_HEIGHT); _images = new Image[PIECEN_TYPES]; for (int i = 0; i < PIECEN_TYPES; i++) { - _images[i] = piecenSet.getTileImage(i); + _images[i] = piecenSet.getRawTileImage(i); } }