I decided to go hog wild and clean up all the type use in Presents which
required some serious bending and folding of the generic type system, but for the most part we managed to avoid any mutilating. The gendobj task now generates properly typed "addToXXX" and "updateXXX" DSet methods based on the parameterized type of the DSet. This might cause unrecompiled code to break, but I don't think there are many cases in the base toolkit where people call DSet adders or updaters. We'll see and I'll add backwards compatibility versions for cases where we need them to support GG games (everything else we can just recompile). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4245 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -35,14 +35,14 @@ import com.threerings.presents.dobj.Subscriber;
|
||||
* complete before the subscriber decides they no longer wish to be
|
||||
* subscribed.
|
||||
*/
|
||||
public class SafeSubscriber
|
||||
implements Subscriber
|
||||
public class SafeSubscriber<T extends DObject>
|
||||
implements Subscriber<T>
|
||||
{
|
||||
/**
|
||||
* Creates a safe subscriber for the specified distributed object
|
||||
* which will interact with the specified subscriber.
|
||||
*/
|
||||
public SafeSubscriber (int oid, Subscriber subscriber)
|
||||
public SafeSubscriber (int oid, Subscriber<T> subscriber)
|
||||
{
|
||||
// make sure they're not fucking us around
|
||||
if (oid <= 0) {
|
||||
@@ -157,7 +157,7 @@ public class SafeSubscriber
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public void objectAvailable (DObject object)
|
||||
public void objectAvailable (T object)
|
||||
{
|
||||
// make sure life is not too cruel
|
||||
if (_object != null) {
|
||||
@@ -224,8 +224,8 @@ public class SafeSubscriber
|
||||
}
|
||||
|
||||
protected int _oid;
|
||||
protected Subscriber _subscriber;
|
||||
protected DObject _object;
|
||||
protected Subscriber<T> _subscriber;
|
||||
protected T _object;
|
||||
protected boolean _active;
|
||||
protected boolean _pending;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user