Added build directives to generate dobj source files; made test object a

generated dobj class.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@969 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-08 23:17:38 +00:00
parent 1258fee18b
commit fcca82c3f6
3 changed files with 96 additions and 36 deletions
+9 -1
View File
@@ -25,8 +25,16 @@
<fileset dir="${java.libraries}" includes="**/*.jar"/>
</path>
<!-- generates .java files for all .dobj files -->
<target name="gendobj">
<apply executable="../bin/gendobj" failonerror="true">
<srcfile/>
<fileset dir="src/java" includes="**/*.dobj"/>
</apply>
</target>
<!-- prepares the application directories -->
<target name="prepare">
<target name="prepare" depends="gendobj">
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${deploy.dir}/classes"/>
<copy todir="${deploy.dir}/classes">
@@ -1,49 +1,16 @@
//
// $Id: TestObject.dobj,v 1.6 2002/02/05 20:27:59 mdb Exp $
// $Id: TestObject.dobj,v 1.7 2002/02/08 23:17:38 mdb Exp $
package com.threerings.presents.server;
import com.threerings.presents.dobj.*;
/**
* I use this to test until I get the actual DObject generation script
* working.
* A test distributed object.
*/
public class TestObject extends DObject
{
public static final String FOO = "foo";
public static final String BAR = "bar";
public static final String LIST = "list";
public int foo;
public String bar;
public OidList list = new OidList();
public void setFoo (int foo)
{
requestAttributeChange(FOO, new Integer(foo));
}
public void setBar (String bar)
{
requestAttributeChange(BAR, bar);
}
/**
* Requests that the specified oid be added to the
* <code>list</code> oid list.
*/
public void addToList (int oid)
{
requestOidAdd(LIST, oid);
}
/**
* Requests that the specified oid be removed from the
* <code>list</code> oid list.
*/
public void removeFromList (int oid)
{
requestOidRemove(LIST, oid);
}
}
@@ -0,0 +1,85 @@
//
// $Id: TestObject.java,v 1.1 2002/02/08 23:17:38 mdb Exp $
package com.threerings.presents.server;
import com.threerings.presents.dobj.*;
/**
* A test distributed object.
*/
public class TestObject extends DObject
{
/** The field name of the <code>foo</code> field. */
public static final String FOO = "foo";
/** The field name of the <code>bar</code> field. */
public static final String BAR = "bar";
/** The field name of the <code>list</code> field. */
public static final String LIST = "list";
public int foo;
public String bar;
public OidList list = new OidList();
/**
* Requests that the <code>foo</code> field be set to the specified
* value.
*/
public void setFoo (int foo)
{
requestAttributeChange(FOO, new Integer(foo));
}
/**
* Requests that the <code>foo</code> field be set to the
* specified value and immediately updates the state of the object
* to reflect the change. This should <em>only</em> be called on the
* server and only then if you know what you're doing.
*/
public void setFooImmediate (int foo)
{
this.foo = foo;
requestAttributeChange(FOO, new Integer(foo));
}
/**
* Requests that the <code>bar</code> field be set to the specified
* value.
*/
public void setBar (String bar)
{
requestAttributeChange(BAR, bar);
}
/**
* Requests that the <code>bar</code> field be set to the
* specified value and immediately updates the state of the object
* to reflect the change. This should <em>only</em> be called on the
* server and only then if you know what you're doing.
*/
public void setBarImmediate (String bar)
{
this.bar = bar;
requestAttributeChange(BAR, bar);
}
/**
* Requests that the specified oid be added to the
* <code>list</code> oid list.
*/
public void addToList (int oid)
{
requestOidAdd(LIST, oid);
}
/**
* Requests that the specified oid be removed from the
* <code>list</code> oid list.
*/
public void removeFromList (int oid)
{
requestOidRemove(LIST, oid);
}
}