From df9b6c2657fc5a287252d443c0fd69e095a663e7 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 1 May 2007 23:40:44 +0000 Subject: [PATCH] PuzzleConfig was totally pointless and prevented Yohoho from having all of its game configs inherit from a single enhanced config. It also prevented the puzzle stuff from being used by ToyBox. It is now gone and Yohoho is even more broken, but the fixes are in progress. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@287 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../puzzle/client/PlayerStatusView.java | 4 +- .../puzzle/client/PuzzleBoardView.java | 4 +- .../puzzle/client/PuzzleController.java | 7 +-- .../threerings/puzzle/client/PuzzlePanel.java | 8 +-- .../threerings/puzzle/data/PuzzleConfig.java | 51 ------------------- .../puzzle/drop/client/DropBoardView.java | 4 +- .../puzzle/server/PuzzleManager.java | 13 ----- 7 files changed, 11 insertions(+), 80 deletions(-) delete mode 100644 src/java/com/threerings/puzzle/data/PuzzleConfig.java diff --git a/src/java/com/threerings/puzzle/client/PlayerStatusView.java b/src/java/com/threerings/puzzle/client/PlayerStatusView.java index 26246409..6d1f24d4 100644 --- a/src/java/com/threerings/puzzle/client/PlayerStatusView.java +++ b/src/java/com/threerings/puzzle/client/PlayerStatusView.java @@ -25,10 +25,10 @@ import javax.swing.JPanel; import com.threerings.util.Name; +import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameObject; import com.threerings.puzzle.data.BoardSummary; -import com.threerings.puzzle.data.PuzzleConfig; import com.threerings.puzzle.data.PuzzleObject; /** @@ -53,7 +53,7 @@ public class PlayerStatusView extends JPanel /** * Initializes the player status view with the puzzle config. */ - public void init (PuzzleConfig config) + public void init (GameConfig config) { // nothing for now } diff --git a/src/java/com/threerings/puzzle/client/PuzzleBoardView.java b/src/java/com/threerings/puzzle/client/PuzzleBoardView.java index 52ba48cd..79785dc3 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleBoardView.java +++ b/src/java/com/threerings/puzzle/client/PuzzleBoardView.java @@ -43,12 +43,12 @@ import com.threerings.media.animation.AnimationArranger; import com.threerings.media.image.Mirage; import com.threerings.media.sprite.Sprite; +import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.media.ScoreAnimation; import com.threerings.puzzle.Log; import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.PuzzleCodes; -import com.threerings.puzzle.data.PuzzleConfig; import com.threerings.puzzle.util.PuzzleContext; /** @@ -70,7 +70,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel /** * Initializes the board with the board dimensions. */ - public void init (PuzzleConfig config) + public void init (GameConfig config) { // save off our bounds Dimension bounds = getPreferredSize(); diff --git a/src/java/com/threerings/puzzle/client/PuzzleController.java b/src/java/com/threerings/puzzle/client/PuzzleController.java index bbce3292..a06637fc 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleController.java +++ b/src/java/com/threerings/puzzle/client/PuzzleController.java @@ -53,7 +53,6 @@ import com.threerings.parlor.game.data.GameObject; import com.threerings.puzzle.Log; import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.PuzzleCodes; -import com.threerings.puzzle.data.PuzzleConfig; import com.threerings.puzzle.data.PuzzleObject; import com.threerings.puzzle.util.PuzzleContext; @@ -96,8 +95,7 @@ public abstract class PuzzleController extends GameController _pctx = (PuzzleContext)_ctx; // initialize the puzzle panel - _puzconfig = (PuzzleConfig)_config; - _panel.init(_puzconfig); + _panel.init(_config); // initialize the board view _pview = _panel.getBoardView(); @@ -917,9 +915,6 @@ public abstract class PuzzleController extends GameController /** The puzzle panel. */ protected PuzzlePanel _panel; - /** The puzzle config. */ - protected PuzzleConfig _puzconfig; - /** A reference to our puzzle game object. */ protected PuzzleObject _puzobj; diff --git a/src/java/com/threerings/puzzle/client/PuzzlePanel.java b/src/java/com/threerings/puzzle/client/PuzzlePanel.java index 152fcbf9..68aa0b0e 100644 --- a/src/java/com/threerings/puzzle/client/PuzzlePanel.java +++ b/src/java/com/threerings/puzzle/client/PuzzlePanel.java @@ -34,11 +34,11 @@ import com.threerings.util.KeyTranslator; import com.threerings.crowd.client.PlaceView; import com.threerings.crowd.data.PlaceObject; +import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.util.RobotPlayer; import com.threerings.puzzle.Log; import com.threerings.puzzle.data.PuzzleCodes; -import com.threerings.puzzle.data.PuzzleConfig; import com.threerings.puzzle.data.PuzzleGameCodes; import com.threerings.puzzle.util.PuzzleContext; @@ -151,7 +151,7 @@ public abstract class PuzzlePanel extends JPanel * Initializes the puzzle panel with the puzzle config of the puzzle * whose user interface is being displayed by the panel */ - public void init (PuzzleConfig config) + public void init (GameConfig config) { _config = config; _bview.init(config); @@ -291,8 +291,8 @@ public abstract class PuzzlePanel extends JPanel /** The board overlay panel displayed as requested. */ protected JPanel _opanel; - /** The puzzle config. */ - protected PuzzleConfig _config; + /** The game config. */ + protected GameConfig _config; /** The robot player. */ protected RobotPlayer _robot; diff --git a/src/java/com/threerings/puzzle/data/PuzzleConfig.java b/src/java/com/threerings/puzzle/data/PuzzleConfig.java deleted file mode 100644 index e452b427..00000000 --- a/src/java/com/threerings/puzzle/data/PuzzleConfig.java +++ /dev/null @@ -1,51 +0,0 @@ -// -// $Id$ -// -// Vilya library - tools for developing networked games -// Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved -// http://www.threerings.net/code/vilya/ -// -// This library is free software; you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as published -// by the Free Software Foundation; either version 2.1 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -package com.threerings.puzzle.data; - -import com.threerings.parlor.game.data.GameConfig; - -/** - * Encapsulates the basic configuration information for a puzzle game. - */ -public abstract class PuzzleConfig extends GameConfig - implements Cloneable -{ - /** - * Constructs a blank puzzle config. - */ - public PuzzleConfig () - { - } - - /** - * Returns the message bundle identifier for the bundle that should be - * used to translate the translatable strings used to describe the - * puzzle config parameters. The default implementation returns the - * base puzzle message bundle, but puzzles that have their own message - * bundle should override this method and return their puzzle-specific - * bundle identifier. - */ - public String getBundleName () - { - return PuzzleCodes.PUZZLE_MESSAGE_BUNDLE; - } -} diff --git a/src/java/com/threerings/puzzle/drop/client/DropBoardView.java b/src/java/com/threerings/puzzle/drop/client/DropBoardView.java index 2956b809..7342f15f 100644 --- a/src/java/com/threerings/puzzle/drop/client/DropBoardView.java +++ b/src/java/com/threerings/puzzle/drop/client/DropBoardView.java @@ -37,12 +37,12 @@ import com.threerings.media.sprite.Sprite; import com.threerings.media.util.LinePath; import com.threerings.media.util.Path; +import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.media.ScoreAnimation; import com.threerings.puzzle.Log; import com.threerings.puzzle.client.PuzzleBoardView; import com.threerings.puzzle.data.Board; -import com.threerings.puzzle.data.PuzzleConfig; import com.threerings.puzzle.util.PuzzleContext; import com.threerings.puzzle.drop.data.DropBoard; @@ -80,7 +80,7 @@ public abstract class DropBoardView extends PuzzleBoardView /** * Initializes the board with the board dimensions. */ - public void init (PuzzleConfig config) + public void init (GameConfig config) { DropConfig dconfig = (DropConfig)config; diff --git a/src/java/com/threerings/puzzle/server/PuzzleManager.java b/src/java/com/threerings/puzzle/server/PuzzleManager.java index f91e2036..e1328664 100644 --- a/src/java/com/threerings/puzzle/server/PuzzleManager.java +++ b/src/java/com/threerings/puzzle/server/PuzzleManager.java @@ -46,7 +46,6 @@ import com.threerings.puzzle.Log; import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.BoardSummary; import com.threerings.puzzle.data.PuzzleCodes; -import com.threerings.puzzle.data.PuzzleConfig; import com.threerings.puzzle.data.PuzzleGameMarshaller; import com.threerings.puzzle.data.PuzzleObject; @@ -169,15 +168,6 @@ public abstract class PuzzleManager extends GameManager return false; } - // documentation inherited - protected void didInit () - { - super.didInit(); - - // save off a casted reference to our puzzle config - _puzconfig = (PuzzleConfig)_config; - } - // documentation inherited protected void didStartup () { @@ -609,9 +599,6 @@ public abstract class PuzzleManager extends GameManager // nothing for now } - /** A casted reference to our puzzle config object. */ - protected PuzzleConfig _puzconfig; - /** A casted reference to our puzzle game object. */ protected PuzzleObject _puzobj;