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
This commit is contained in:
Michael Bayne
2007-05-01 23:40:44 +00:00
parent 7538ddcc7f
commit df9b6c2657
7 changed files with 11 additions and 80 deletions
@@ -25,10 +25,10 @@ import javax.swing.JPanel;
import com.threerings.util.Name; import com.threerings.util.Name;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.game.data.GameObject; import com.threerings.parlor.game.data.GameObject;
import com.threerings.puzzle.data.BoardSummary; import com.threerings.puzzle.data.BoardSummary;
import com.threerings.puzzle.data.PuzzleConfig;
import com.threerings.puzzle.data.PuzzleObject; import com.threerings.puzzle.data.PuzzleObject;
/** /**
@@ -53,7 +53,7 @@ public class PlayerStatusView extends JPanel
/** /**
* Initializes the player status view with the puzzle config. * Initializes the player status view with the puzzle config.
*/ */
public void init (PuzzleConfig config) public void init (GameConfig config)
{ {
// nothing for now // nothing for now
} }
@@ -43,12 +43,12 @@ import com.threerings.media.animation.AnimationArranger;
import com.threerings.media.image.Mirage; import com.threerings.media.image.Mirage;
import com.threerings.media.sprite.Sprite; import com.threerings.media.sprite.Sprite;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.media.ScoreAnimation; import com.threerings.parlor.media.ScoreAnimation;
import com.threerings.puzzle.Log; import com.threerings.puzzle.Log;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.PuzzleCodes; import com.threerings.puzzle.data.PuzzleCodes;
import com.threerings.puzzle.data.PuzzleConfig;
import com.threerings.puzzle.util.PuzzleContext; import com.threerings.puzzle.util.PuzzleContext;
/** /**
@@ -70,7 +70,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
/** /**
* Initializes the board with the board dimensions. * Initializes the board with the board dimensions.
*/ */
public void init (PuzzleConfig config) public void init (GameConfig config)
{ {
// save off our bounds // save off our bounds
Dimension bounds = getPreferredSize(); Dimension bounds = getPreferredSize();
@@ -53,7 +53,6 @@ import com.threerings.parlor.game.data.GameObject;
import com.threerings.puzzle.Log; import com.threerings.puzzle.Log;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.PuzzleCodes; import com.threerings.puzzle.data.PuzzleCodes;
import com.threerings.puzzle.data.PuzzleConfig;
import com.threerings.puzzle.data.PuzzleObject; import com.threerings.puzzle.data.PuzzleObject;
import com.threerings.puzzle.util.PuzzleContext; import com.threerings.puzzle.util.PuzzleContext;
@@ -96,8 +95,7 @@ public abstract class PuzzleController extends GameController
_pctx = (PuzzleContext)_ctx; _pctx = (PuzzleContext)_ctx;
// initialize the puzzle panel // initialize the puzzle panel
_puzconfig = (PuzzleConfig)_config; _panel.init(_config);
_panel.init(_puzconfig);
// initialize the board view // initialize the board view
_pview = _panel.getBoardView(); _pview = _panel.getBoardView();
@@ -917,9 +915,6 @@ public abstract class PuzzleController extends GameController
/** The puzzle panel. */ /** The puzzle panel. */
protected PuzzlePanel _panel; protected PuzzlePanel _panel;
/** The puzzle config. */
protected PuzzleConfig _puzconfig;
/** A reference to our puzzle game object. */ /** A reference to our puzzle game object. */
protected PuzzleObject _puzobj; protected PuzzleObject _puzobj;
@@ -34,11 +34,11 @@ import com.threerings.util.KeyTranslator;
import com.threerings.crowd.client.PlaceView; import com.threerings.crowd.client.PlaceView;
import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.data.PlaceObject;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.util.RobotPlayer; import com.threerings.parlor.util.RobotPlayer;
import com.threerings.puzzle.Log; import com.threerings.puzzle.Log;
import com.threerings.puzzle.data.PuzzleCodes; import com.threerings.puzzle.data.PuzzleCodes;
import com.threerings.puzzle.data.PuzzleConfig;
import com.threerings.puzzle.data.PuzzleGameCodes; import com.threerings.puzzle.data.PuzzleGameCodes;
import com.threerings.puzzle.util.PuzzleContext; 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 * Initializes the puzzle panel with the puzzle config of the puzzle
* whose user interface is being displayed by the panel * whose user interface is being displayed by the panel
*/ */
public void init (PuzzleConfig config) public void init (GameConfig config)
{ {
_config = config; _config = config;
_bview.init(config); _bview.init(config);
@@ -291,8 +291,8 @@ public abstract class PuzzlePanel extends JPanel
/** The board overlay panel displayed as requested. */ /** The board overlay panel displayed as requested. */
protected JPanel _opanel; protected JPanel _opanel;
/** The puzzle config. */ /** The game config. */
protected PuzzleConfig _config; protected GameConfig _config;
/** The robot player. */ /** The robot player. */
protected RobotPlayer _robot; protected RobotPlayer _robot;
@@ -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;
}
}
@@ -37,12 +37,12 @@ import com.threerings.media.sprite.Sprite;
import com.threerings.media.util.LinePath; import com.threerings.media.util.LinePath;
import com.threerings.media.util.Path; import com.threerings.media.util.Path;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.media.ScoreAnimation; import com.threerings.parlor.media.ScoreAnimation;
import com.threerings.puzzle.Log; import com.threerings.puzzle.Log;
import com.threerings.puzzle.client.PuzzleBoardView; import com.threerings.puzzle.client.PuzzleBoardView;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.PuzzleConfig;
import com.threerings.puzzle.util.PuzzleContext; import com.threerings.puzzle.util.PuzzleContext;
import com.threerings.puzzle.drop.data.DropBoard; import com.threerings.puzzle.drop.data.DropBoard;
@@ -80,7 +80,7 @@ public abstract class DropBoardView extends PuzzleBoardView
/** /**
* Initializes the board with the board dimensions. * Initializes the board with the board dimensions.
*/ */
public void init (PuzzleConfig config) public void init (GameConfig config)
{ {
DropConfig dconfig = (DropConfig)config; DropConfig dconfig = (DropConfig)config;
@@ -46,7 +46,6 @@ import com.threerings.puzzle.Log;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.BoardSummary; import com.threerings.puzzle.data.BoardSummary;
import com.threerings.puzzle.data.PuzzleCodes; import com.threerings.puzzle.data.PuzzleCodes;
import com.threerings.puzzle.data.PuzzleConfig;
import com.threerings.puzzle.data.PuzzleGameMarshaller; import com.threerings.puzzle.data.PuzzleGameMarshaller;
import com.threerings.puzzle.data.PuzzleObject; import com.threerings.puzzle.data.PuzzleObject;
@@ -169,15 +168,6 @@ public abstract class PuzzleManager extends GameManager
return false; return false;
} }
// documentation inherited
protected void didInit ()
{
super.didInit();
// save off a casted reference to our puzzle config
_puzconfig = (PuzzleConfig)_config;
}
// documentation inherited // documentation inherited
protected void didStartup () protected void didStartup ()
{ {
@@ -609,9 +599,6 @@ public abstract class PuzzleManager extends GameManager
// nothing for now // nothing for now
} }
/** A casted reference to our puzzle config object. */
protected PuzzleConfig _puzconfig;
/** A casted reference to our puzzle game object. */ /** A casted reference to our puzzle game object. */
protected PuzzleObject _puzobj; protected PuzzleObject _puzobj;