Ran the auto-generator on all our Streamable stuff in Narya. Tidied up the

results.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4395 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2006-10-04 02:07:04 +00:00
parent 8015764c61
commit 398767da5f
11 changed files with 449 additions and 66 deletions
@@ -22,6 +22,7 @@
package com.threerings.crowd.chat.data {
import com.threerings.util.ClassUtil;
import com.threerings.util.Long;
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
@@ -43,6 +44,9 @@ public /*abstract*/ class ChatMessage
* registered with an auxiliary source in the ChatDirector. */
public var localtype :String;
/** The client time that this message was created. */
public var timestamp :Long;
public function ChatMessage (msg :String = null, bundle :String = null)
{
this.message = msg;
@@ -70,14 +74,14 @@ public /*abstract*/ class ChatMessage
" [message=" + message + ", bundle=" + bundle + "]";
}
// documentation inherited from interface Streamable
// from interface Streamable
public function readObject (ins :ObjectInputStream) :void
{
message = (ins.readField(String) as String);
bundle = (ins.readField(String) as String);
}
// documentation inherited from interface Streamable
// from interface Streamable
public function writeObject (out :ObjectOutputStream) :void
{
out.writeField(message);
@@ -32,31 +32,35 @@ public class SystemMessage extends ChatMessage
{
/** Attention level constant to indicate that this message is merely
* providing the user with information. */
public static const INFO :int = 0;
public static const INFO :int = 0;
/** Attention level constant to indicate that this message is the
* result of a user action. */
public static const FEEDBACK :int = 1;
public static const FEEDBACK :int = 1;
/** Attention level constant to indicate that some action is required. */
public static const ATTENTION :int = 2;
//----
/** The attention level of this message. */
public var attentionLevel :int;
public function SystemMessage (
msg :String = null, bundle :String = null, attLevel :int = 0)
msg :String = null, bundle :String = null, attLevel :int = 0)
{
super(msg, bundle);
this.attentionLevel = attLevel;
}
// from interface Streamable
override public function readObject (ins :ObjectInputStream) :void
{
super.readObject(ins);
attentionLevel = ins.readByte();
}
// from interface Streamable
override public function writeObject (out :ObjectOutputStream) :void
{
super.writeObject(out);
@@ -37,6 +37,29 @@ public class UserMessage extends ChatMessage
/** The mode of the message. @see ChatCodes.DEFAULT_MODE */
public var mode :int;
/**
* Constructs a user message for a player originated tell (which has no
* bundle and is in the default mode).
*/
public function UserMessage (speaker :Name = null, bundle :String = null,
message :String = null, mode :int = 0)
{
super(message, bundle);
this.speaker = speaker;
this.mode = mode;
}
/**
* Returns the name to display for the speaker. Some types of messages
* may wish to not use the canonical name for the speaker and should thus
* override this function.
*/
public function getSpeakerDisplayName () :Name
{
return speaker;
}
// from interface Streamable
override public function readObject (ins :ObjectInputStream) :void
{
super.readObject(ins);
@@ -44,6 +67,7 @@ public class UserMessage extends ChatMessage
mode = ins.readByte();
}
// from interface Streamable
override public function writeObject (out :ObjectOutputStream) :void
{
super.writeObject(out);
@@ -23,8 +23,8 @@ public class UserSystemMessage extends SystemMessage
* Construct a UserSystemMessage.
*/
public function UserSystemMessage (
sender :Name = null, message :String = null, bundle :String = null,
attLevel :int = 0)
sender :Name = null, message :String = null, bundle :String = null,
attLevel :int = 0)
{
super(message, bundle, attLevel);
this.speaker = sender;
@@ -36,6 +36,7 @@ public class UserSystemMessage extends SystemMessage
speaker = (ins.readObject() as Name);
}
// from interface Streamable
override public function writeObject (out :ObjectOutputStream) :void
{
super.writeObject(out);