Because only the editor and viewer even care about the scene repository,
we're eliminating the concept entirely from the MISO runtime stuff and having the editor and viewer just talk directly to the XML file scene repository. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@247 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// $Id: SceneRepository.java,v 1.2 2001/08/15 00:00:51 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* The SceneRepository interface manages persistent scene storage.
|
||||
*/
|
||||
public interface SceneRepository
|
||||
{
|
||||
/**
|
||||
* Loads and returns the scene object with the specified id.
|
||||
*
|
||||
* @param fname the full pathname to the file.
|
||||
*
|
||||
* @return the scene object.
|
||||
*/
|
||||
public Scene loadScene (String fname) throws IOException;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
//
|
||||
// $Id: SceneRepositoryImpl.java,v 1.2 2001/08/09 00:01:58 shaper Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
import com.samskivert.util.Config;
|
||||
import com.threerings.miso.tile.TileManager;
|
||||
|
||||
public abstract class SceneRepositoryImpl implements SceneRepository
|
||||
{
|
||||
/**
|
||||
* Initialize the SceneRepository with the given config and tile
|
||||
* manager objects. The root scene directory is read from the
|
||||
* given config object, and the tile manager is used to obtain
|
||||
* tiles when constructing scene objects from files.
|
||||
*
|
||||
* @param config the config object.
|
||||
* @param tilemgr the tile manager object.
|
||||
*/
|
||||
public void init (Config config, TileManager tilemgr)
|
||||
{
|
||||
_config = config;
|
||||
_tilemgr = tilemgr;
|
||||
}
|
||||
|
||||
/** The config object. */
|
||||
protected Config _config;
|
||||
|
||||
/** The tile manager from which the scenes obtain their tiles. */
|
||||
protected TileManager _tilemgr;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: XMLSceneRepository.java,v 1.5 2001/08/09 00:01:58 shaper Exp $
|
||||
// $Id: XMLSceneRepository.java,v 1.6 2001/08/15 00:10:58 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene.xml;
|
||||
|
||||
@@ -9,16 +9,15 @@ import java.util.ArrayList;
|
||||
import com.samskivert.util.Config;
|
||||
import com.threerings.miso.Log;
|
||||
import com.threerings.miso.scene.Scene;
|
||||
import com.threerings.miso.scene.SceneRepositoryImpl;
|
||||
import com.threerings.miso.tile.TileManager;
|
||||
|
||||
/**
|
||||
* The XMLFileSceneRepository provides a mechanism for reading scenes
|
||||
* from and writing scenes to XML files. These files will comprise
|
||||
* the template scene files from which actual runtime game scenes will
|
||||
* be constructed.
|
||||
* The <code>XMLFileSceneRepository</code> provides a mechanism for
|
||||
* reading scenes from and writing scenes to XML files. These files will
|
||||
* comprise the template scene files from which actual runtime game scenes
|
||||
* will be constructed.
|
||||
*/
|
||||
public class XMLFileSceneRepository extends SceneRepositoryImpl
|
||||
public class XMLFileSceneRepository
|
||||
{
|
||||
/**
|
||||
* Initialize the XMLFileSceneRepository with the given config and
|
||||
@@ -29,7 +28,9 @@ public class XMLFileSceneRepository extends SceneRepositoryImpl
|
||||
*/
|
||||
public void init (Config config, TileManager tilemgr)
|
||||
{
|
||||
super.init(config, tilemgr);
|
||||
// keep these for later
|
||||
_config = config;
|
||||
_tilemgr = tilemgr;
|
||||
|
||||
// get path-related information
|
||||
_sep = System.getProperty("file.separator", "/");
|
||||
@@ -81,11 +82,11 @@ public class XMLFileSceneRepository extends SceneRepositoryImpl
|
||||
_writer.saveScene(scene, path);
|
||||
}
|
||||
|
||||
/** The config key for the root scene directory. */
|
||||
protected static final String CFG_SROOT = "miso.sceneroot";
|
||||
/** The config object. */
|
||||
protected Config _config;
|
||||
|
||||
/** The default root scene directory path. */
|
||||
protected static final String DEF_SROOT = "rsrc/scenes";
|
||||
/** The tile manager from which the scenes obtain their tiles. */
|
||||
protected TileManager _tilemgr;
|
||||
|
||||
/** The main program absolute root directory. */
|
||||
protected String _root;
|
||||
@@ -101,4 +102,10 @@ public class XMLFileSceneRepository extends SceneRepositoryImpl
|
||||
|
||||
/** The writer object for writing scenes to files. */
|
||||
protected XMLSceneWriter _writer;
|
||||
|
||||
/** The config key for the root scene directory. */
|
||||
protected static final String CFG_SROOT = "miso.sceneroot";
|
||||
|
||||
/** The default root scene directory path. */
|
||||
protected static final String DEF_SROOT = "rsrc/scenes";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user