Added support for cloning scene models (we love doing multiple inheritance
by hand!). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@754 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: SceneModel.java,v 1.4 2001/11/30 21:54:34 mdb Exp $
|
||||
// $Id: SceneModel.java,v 1.5 2001/12/12 02:47:17 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.data;
|
||||
|
||||
@@ -21,7 +21,8 @@ import com.threerings.presents.io.Streamable;
|
||||
* what is transmitted over the wire when communicating scenes from the
|
||||
* server to the client.
|
||||
*/
|
||||
public class SceneModel implements Streamable
|
||||
public class SceneModel
|
||||
implements Streamable, Cloneable
|
||||
{
|
||||
/** This scene's unique identifier. */
|
||||
public int sceneId;
|
||||
@@ -72,6 +73,15 @@ public class SceneModel implements Streamable
|
||||
return buf.append("]").toString();
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public Object clone ()
|
||||
throws CloneNotSupportedException
|
||||
{
|
||||
SceneModel model = (SceneModel)super.clone();
|
||||
model.neighborIds = (int[])neighborIds.clone();
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Derived classes override this to tack their <code>toString</code>
|
||||
* data on to the string buffer.
|
||||
|
||||
Reference in New Issue
Block a user