Match recent changes in our corresponding java classes.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@14 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2006-07-12 02:22:32 +00:00
parent 50c7b2b8dd
commit 5708f56203
2 changed files with 9 additions and 5 deletions
@@ -82,11 +82,13 @@ public class Portal
/** /**
* Returns true if the portal has a potentially valid target scene and * Returns true if the portal has a potentially valid target scene and
* portal id (they are not guaranteed to exist, but they are at least * portal id (they are not guaranteed to exist, but they are at least
* potentially valid values rather than -1 or 0). * potentially valid values rather than 0).
*/ */
public function isValid () :Boolean public function isValid () :Boolean
{ {
return (targetSceneId > 0) && (targetPortalId > 0); return (targetSceneId > 0) &&
// the target portal must be positive, or -1
((targetPortalId > 0) || (targetPortalId == -1));
} }
// documentation inherited from interface Streamable // documentation inherited from interface Streamable
@@ -110,8 +112,7 @@ public class Portal
// documentation inherited from interface Cloneable // documentation inherited from interface Cloneable
public function clone () :Object public function clone () :Object
{ {
var clazz :Class = ClassUtil.getClass(this); var p :Portal = (ClassUtil.newInstance(this) as Portal);
var p :Portal = new clazz();
p.portalId = portalId; p.portalId = portalId;
p.loc = loc; p.loc = loc;
p.targetSceneId = targetSceneId; p.targetSceneId = targetSceneId;
@@ -57,6 +57,9 @@ public class SpotSceneImpl
// documentation inherited from interface // documentation inherited from interface
public function getPortal (portalId :int) :Portal public function getPortal (portalId :int) :Portal
{ {
if (portalId == -1) {
portalId = _smodel.defaultEntranceId;
}
return (_portals.get(portalId) as Portal); return (_portals.get(portalId) as Portal);
} }
@@ -87,7 +90,7 @@ public class SpotSceneImpl
// documentation inherited from interface // documentation inherited from interface
public function getDefaultEntrance () :Portal public function getDefaultEntrance () :Portal
{ {
return getPortal(_smodel.defaultEntranceId); return getPortal(-1); // -1 is a shortcut meaning "default"
} }
// documentation inherited from interface // documentation inherited from interface