Zones! Scenes can be grouped into zones which are traversed via a

higher-level mechanism. Zones provide zone summaries which can be used to
generate maps of the zones on the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@727 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-12-04 00:31:58 +00:00
parent 9de32d32ea
commit 0748521613
9 changed files with 589 additions and 0 deletions
@@ -0,0 +1,54 @@
//
// $Id: ZoneSummary.java,v 1.1 2001/12/04 00:31:58 mdb Exp $
package com.threerings.whirled.zone.data;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import com.threerings.presents.io.Streamable;
/**
* The zone summary contains information on a zone, including its name and
* summary info on all of the scenes in this zone (which can be used to
* generate a map of the zone on the client).
*/
public class ZoneSummary implements Streamable
{
/** The zone's unique identifier. */
public int zoneId;
/** The name of the zone. */
public String name;
/** The summary information for all of the scenes in the zone. */
public SceneSummary[] scenes;
// documentation inherited
public void writeTo (DataOutputStream out)
throws IOException
{
out.writeInt(zoneId);
out.writeUTF(name);
int scount = scenes.length;
out.writeInt(scount);
for (int i = 0; i < scount; i++) {
scenes[i].writeTo(out);
}
}
// documentation inherited
public void readFrom (DataInputStream in)
throws IOException
{
zoneId = in.readInt();
name = in.readUTF();
int scount = in.readInt();
scenes = new SceneSummary[scount];
for (int i = 0; i < scount; i++) {
scenes[i] = new SceneSummary();
scenes[i].readFrom(in);
}
}
}