Converted more dobj classes to use the gendobj script. (Had to do a wee

bit of fiddling to accomplish some things that used to be done by hand.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@973 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-08 23:55:25 +00:00
parent 05a8a19a12
commit 5581b3e65b
9 changed files with 272 additions and 76 deletions
@@ -1,10 +1,15 @@
//
// $Id: LobbyObject.dobj,v 1.3 2001/10/11 04:13:33 mdb Exp $
// $Id: LobbyObject.dobj,v 1.4 2002/02/08 23:55:24 mdb Exp $
package com.threerings.micasa.lobby;
import com.threerings.crowd.data.PlaceObject;
/**
* Presently the lobby object contains nothing specific, but the class
* acts as a placeholder in case lobby-wide fields are needed in the
* future.
*/
public class LobbyObject extends PlaceObject
{
}
@@ -0,0 +1,15 @@
//
// $Id: LobbyObject.java,v 1.1 2002/02/08 23:55:24 mdb Exp $
package com.threerings.micasa.lobby;
import com.threerings.crowd.data.PlaceObject;
/**
* Presently the lobby object contains nothing specific, but the class
* acts as a placeholder in case lobby-wide fields are needed in the
* future.
*/
public class LobbyObject extends PlaceObject
{
}
@@ -1,5 +1,5 @@
//
// $Id: TableListView.java,v 1.2 2001/10/23 23:52:01 mdb Exp $
// $Id: TableListView.java,v 1.3 2002/02/08 23:55:24 mdb Exp $
package com.threerings.micasa.lobby.table;
@@ -59,7 +59,7 @@ public class TableListView
_ctx = ctx;
// create our table director
_tdtr = new TableDirector(ctx, TableLobbyObject.TABLES, this);
_tdtr = new TableDirector(ctx, TableLobbyObject.TABLE_SET, this);
// add ourselves as a seatedness observer
_tdtr.addSeatednessObserver(this);
@@ -132,7 +132,7 @@ public class TableListView
// iterate over the tables already active in this lobby and put
// them in their respective lists
TableLobbyObject tlobj = (TableLobbyObject)place;
Iterator iter = tlobj.tables.elements();
Iterator iter = tlobj.tableSet.elements();
while (iter.hasNext()) {
tableAdded((Table)iter.next());
}
@@ -1,5 +1,5 @@
//
// $Id: TableLobbyObject.dobj,v 1.1 2001/10/23 20:24:10 mdb Exp $
// $Id: TableLobbyObject.dobj,v 1.2 2002/02/08 23:55:24 mdb Exp $
package com.threerings.micasa.lobby.table;
@@ -11,51 +11,30 @@ public class TableLobbyObject
extends LobbyObject
implements com.threerings.parlor.data.TableLobbyObject
{
/** The field name of the <code>tables</code> field. */
public static final String TABLES = "tables";
/** A set containing all of the tables being managed by this lobby. */
public DSet tables = new DSet(Table.class);
public DSet tableSet = new DSet(Table.class);
// documentation inherited
public DSet getTables ()
{
return tables;
return tableSet;
}
/**
* Requests that the <code>tables</code> field be set to the specified
* value.
*/
public void setTables (DSet value)
{
requestAttributeChange(TABLES, value);
}
/**
* Requests that the specified element be added to the
* <code>tables</code> set.
*/
// documentation inherited from interface
public void addToTables (Table table)
{
requestElementAdd(TABLES, table);
addToTableSet(table);
}
/**
* Requests that the specified element be updated in the
* <code>tables</code> set.
*/
// documentation inherited from interface
public void updateTables (Table table)
{
requestElementUpdate(TABLES, table);
updateTableSet(table);
}
/**
* Requests that the element matching the supplied key be removed from
* the <code>tables</code> set.
*/
// documentation inherited from interface
public void removeFromTables (Object key)
{
requestElementRemove(TABLES, key);
removeFromTableSet(key);
}
}
@@ -0,0 +1,81 @@
//
// $Id: TableLobbyObject.java,v 1.1 2002/02/08 23:55:24 mdb Exp $
package com.threerings.micasa.lobby.table;
import com.threerings.presents.dobj.DSet;
import com.threerings.parlor.data.Table;
import com.threerings.micasa.lobby.LobbyObject;
public class TableLobbyObject
extends LobbyObject
implements com.threerings.parlor.data.TableLobbyObject
{
/** The field name of the <code>tableSet</code> field. */
public static final String TABLE_SET = "tableSet";
/** A set containing all of the tables being managed by this lobby. */
public DSet tableSet = new DSet(Table.class);
// documentation inherited
public DSet getTables ()
{
return tableSet;
}
// documentation inherited from interface
public void addToTables (Table table)
{
addToTableSet(table);
}
// documentation inherited from interface
public void updateTables (Table table)
{
updateTableSet(table);
}
// documentation inherited from interface
public void removeFromTables (Object key)
{
removeFromTableSet(key);
}
/**
* Requests that the specified element be added to the
* <code>tableSet</code> set.
*/
public void addToTableSet (DSet.Element elem)
{
requestElementAdd(TABLE_SET, elem);
}
/**
* Requests that the element matching the supplied key be removed from
* the <code>tableSet</code> set.
*/
public void removeFromTableSet (Object key)
{
requestElementRemove(TABLE_SET, key);
}
/**
* Requests that the specified element be updated in the
* <code>tableSet</code> set.
*/
public void updateTableSet (DSet.Element elem)
{
requestElementUpdate(TABLE_SET, elem);
}
/**
* Requests that the <code>tableSet</code> field be set to the
* specified value. Generally one only adds, updates and removes
* elements of a distributed set, but certain situations call for a
* complete replacement of the set value.
*/
public void setTableSet (DSet value)
{
requestAttributeChange(TABLE_SET, value);
}
}