Table creation refactor: Rather than have the game config specify
table configuration parameters that are unneeded once the actual game starts, and requiring each GameConfigurator to duplicate the functionality of standard table setup, I separated TableConfig from GameConfig. If a game wants to be usable in a table matchmaking service, it implements TableableGameConfig, and returns the TableConfigurator to use. There is a default TableConfigurator implementation that just does everything needed. TableConfigurator returns a happily customized TableConfig, which is sent to the server with the GameConfig in order to create the Table. More refactoring needs to happen to get the Party stuff in line, but right now that's all a mess since we're still supporting the old-style party interface for the old drinking puzzle in yohoho. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3525 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -21,43 +21,18 @@
|
||||
|
||||
package com.threerings.parlor.data;
|
||||
|
||||
import com.threerings.io.SimpleStreamableObject;
|
||||
|
||||
/**
|
||||
* A game config object that is to be matchmade using the table services
|
||||
* should implement this interface so that the table services can extract
|
||||
* the necessary table-generic information.
|
||||
* Table configuration parameters for a game that is to be matchmade
|
||||
* using the table services.
|
||||
*/
|
||||
public interface TableConfig
|
||||
public class TableConfig extends SimpleStreamableObject
|
||||
{
|
||||
/**
|
||||
* Returns the minimum number of players needed to start the game.
|
||||
*/
|
||||
public int getMinimumPlayers ();
|
||||
/** The number of players that are desired for the table, or -1 for a
|
||||
* party game. */
|
||||
public int desiredPlayerCount;
|
||||
|
||||
/**
|
||||
* Returns the maximum number of players that can play in the game.
|
||||
*/
|
||||
public int getMaximumPlayers ();
|
||||
|
||||
/**
|
||||
* Returns the number of players that when reached, will cause the
|
||||
* game to automatically be started. If this value is -1 the game will
|
||||
* not automatically be started until the maximum number of players is
|
||||
* reached.
|
||||
*/
|
||||
public int getDesiredPlayers ();
|
||||
|
||||
/**
|
||||
* Sets the desired number of players to the specified value.
|
||||
*/
|
||||
public void setDesiredPlayers (int desiredPlayers);
|
||||
|
||||
/**
|
||||
* Checks whether or not this is a configuration for a private table.
|
||||
*/
|
||||
public boolean isPrivateTable ();
|
||||
|
||||
/**
|
||||
* Sets whether nor not this is a configuration for a private table.
|
||||
*/
|
||||
public void setPrivateTable (boolean privateTable);
|
||||
/** Whether the table is "private". */
|
||||
public boolean privateTable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user