More faffing about.

- started making chat UI stuff
- upgraded SimpleMap some to use the new Dictionary class
- Lots of experimenting with attaching functions to interface implementations.
I've upgraded to the new beta of Flex and it's giving me the pain. There's
new compiler bugs and I am working blind right now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3966 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-22 02:10:37 +00:00
parent 95ff914ab6
commit 7d3ef496fd
17 changed files with 218 additions and 63 deletions
@@ -105,7 +105,9 @@ public class ChatDirector extends BasicDirector
*/
public function addChatDisplay (display :ChatDisplay) :void
{
_displays.addItem(display);
if (-1 == _displays.getItemIndex(display)) {
_displays.addItem(display);
}
}
/**
@@ -166,28 +166,28 @@ public class LocationDirector extends BasicDirector
var listener :MoveListenerProxy = new MoveListenerProxy();
// documentation inherited from interface MoveListener
listener.moveSucceeded = function (config :PlaceConfig) :void
{
// handle the successful move
didMoveTo(_pendingPlaceId, config);
// and clear out the tracked pending oid
_pendingPlaceId = -1;
};
// listener.moveSucceeded = function (config :PlaceConfig) :void
// {
// // handle the successful move
// didMoveTo(_pendingPlaceId, config);
//
// // and clear out the tracked pending oid
// _pendingPlaceId = -1;
// };
// documentation inherited from interface
listener.requestFailed = function (reason :String) :void
{
// clear out our pending request oid
var placeId :int = _pendingPlaceId;
_pendingPlaceId = -1;
Log.info("moveTo failed [pid=" + placeId +
", reason=" + reason + "].");
// let our observers know that something has gone horribly awry
notifyFailure(placeId, reason);
};
// listener.requestFailed = function (reason :String) :void
// {
// // clear out our pending request oid
// var placeId :int = _pendingPlaceId;
// _pendingPlaceId = -1;
//
// Log.info("moveTo failed [pid=" + placeId +
// ", reason=" + reason + "].");
//
// // let our observers know that something has gone horribly awry
// notifyFailure(placeId, reason);
// };
// issue a moveTo request
Log.info("Issuing moveTo(" + placeId + ").");
@@ -408,7 +408,8 @@ public class LocationDirector extends BasicDirector
super.clientDidLogon(event);
// TODO: Work out new anonyclass construct
var sub :SubscriberProxy = new SubscriberProxy();
// var sub :SubscriberProxy = new SubscriberProxy();
var sub :Object = new Object();
sub.objectAvailable = function (object :DObject) :void {
gotBodyObject(object as BodyObject);
};
@@ -417,10 +418,11 @@ public class LocationDirector extends BasicDirector
"object; all has gone horribly wrong" +
"[cause=" + cause + "].");
};
sub.objectAvailable(null);
var client :Client = event.getClient();
var cloid :int = client.getClientOid();
client.getDObjectManager().subscribeToObject(cloid, sub);
client.getDObjectManager().subscribeToObject(cloid, null);
}
// documentation inherited
@@ -611,13 +613,29 @@ public class LocationDirector extends BasicDirector
}
}
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.ObjectAccessError;
import com.threerings.presents.dobj.Subscriber;
import com.threerings.crowd.client.MoveListener;
import com.threerings.crowd.data.PlaceConfig;
dynamic class SubscriberProxy implements Subscriber
{
public function objectAvailable (obj :DObject) :void
{
}
public function requestFailed (oid :int, cause :ObjectAccessError) :void
{
}
}
dynamic class MoveListenerProxy implements MoveListener
{
public function moveSucceeded (config :PlaceConfig) :void
{
}
public function requestFailed (cause :String) :void
{
}
}
@@ -40,14 +40,18 @@ import com.threerings.crowd.client.PlaceController;
* #getControllerClass} and {@link #getManagerClassName}, returning the
* appropriate place controller and manager class for that place.
*/
public interface PlaceConfig extends Streamable
public /*abstract*/ class PlaceConfig
implements Streamable
{
/**
* Returns the class that should be used to create a controller for
* this place. The controller class must derive from {@link
* PlaceController}.
*/
function getControllerClass () :Class;
public function getControllerClass () :Class
{
return null;
}
/**
* Returns the name of the class that should be used to create a
@@ -60,5 +64,16 @@ public interface PlaceConfig extends Streamable
* knowing that it is never used.
*/
// public function getManagerClassName () :String;
// documentation inherited from interface Streamable
public function writeObject (out :ObjectOutputStream) :void
{
// nothing needed
}
public function readObject (ins :ObjectInputStream) :void
{
// nothing needed
}
}
}