Implement TableConfig.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@392 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,19 +1,74 @@
|
|||||||
//
|
//
|
||||||
// $Id: AtlantiConfig.java,v 1.2 2001/10/12 20:34:13 mdb Exp $
|
// $Id: AtlantiConfig.java,v 1.3 2001/10/24 03:24:53 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.venison;
|
package com.threerings.venison;
|
||||||
|
|
||||||
import com.threerings.parlor.game.GameConfig;
|
import java.io.IOException;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
|
||||||
public class VenisonConfig extends GameConfig
|
import com.threerings.parlor.game.GameConfig;
|
||||||
|
import com.threerings.parlor.data.TableConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Describes the configuration parameters for a game of Venison.
|
||||||
|
*/
|
||||||
|
public class VenisonConfig
|
||||||
|
extends GameConfig implements TableConfig
|
||||||
{
|
{
|
||||||
|
// documentation inherited
|
||||||
public Class getControllerClass ()
|
public Class getControllerClass ()
|
||||||
{
|
{
|
||||||
return VenisonController.class;
|
return VenisonController.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
public String getManagerClassName ()
|
public String getManagerClassName ()
|
||||||
{
|
{
|
||||||
return "com.threerings.venison.VenisonManager";
|
return "com.threerings.venison.VenisonManager";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public int getMinimumPlayers ()
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public int getMaximumPlayers ()
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public int getDesiredPlayers ()
|
||||||
|
{
|
||||||
|
return _desiredPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public void setDesiredPlayers (int desiredPlayers)
|
||||||
|
{
|
||||||
|
_desiredPlayers = desiredPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public void writeTo (DataOutputStream out)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
super.writeTo(out);
|
||||||
|
out.writeInt(_desiredPlayers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public void readFrom (DataInputStream in)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
super.readFrom(in);
|
||||||
|
_desiredPlayers = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The desired number of players for this game or -1 if there is no
|
||||||
|
* specific desired number of players. */
|
||||||
|
protected int _desiredPlayers;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user