Moved the typed object registry into the same package with the rest of

the typed object stuff; made events typed so they can be transported;
further wiring up of event dispatch over the network.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@34 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-06-11 17:44:04 +00:00
parent a8bddf0238
commit 89083f4708
11 changed files with 183 additions and 43 deletions
@@ -1,5 +1,5 @@
//
// $Id: EventNotification.java,v 1.6 2001/06/09 23:39:04 mdb Exp $
// $Id: EventNotification.java,v 1.7 2001/06/11 17:44:04 mdb Exp $
package com.threerings.cocktail.cher.net;
@@ -7,7 +7,8 @@ import java.io.IOException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import com.threerings.cocktail.cher.dobj.DEvent;
import com.threerings.cocktail.cher.dobj.TypedEvent;
import com.threerings.cocktail.cher.io.TypedObjectFactory;
public class EventNotification extends DownstreamMessage
{
@@ -25,7 +26,7 @@ public class EventNotification extends DownstreamMessage
/**
* Constructs an event notification for the supplied event.
*/
public EventNotification (DEvent event)
public EventNotification (TypedEvent event)
{
_event = event;
}
@@ -35,7 +36,7 @@ public class EventNotification extends DownstreamMessage
return TYPE;
}
public DEvent getEvent ()
public TypedEvent getEvent ()
{
return _event;
}
@@ -44,16 +45,18 @@ public class EventNotification extends DownstreamMessage
throws IOException
{
super.writeTo(out);
// _event.writeTo(out);
// write the event out to the stream
TypedObjectFactory.writeTo(out, _event);
}
public void readFrom (DataInputStream in)
throws IOException
{
super.readFrom(in);
// _event = EventFactory.readFrom(in);
// read the event in from the stream
_event = (TypedEvent)TypedObjectFactory.readFrom(in);
}
/** The event which we are forwarding. */
protected DEvent _event;
protected TypedEvent _event;
}