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:
Ray Greenwell
2005-04-26 02:38:42 +00:00
parent 2351316259
commit 052cf8e0e2
16 changed files with 265 additions and 190 deletions
@@ -21,12 +21,10 @@
package com.threerings.parlor.game.data;
import com.threerings.parlor.data.TableConfig;
/**
* Provides additional information for party games.
*/
public interface PartyGameConfig extends TableConfig
public interface PartyGameConfig
{
/**
* Returns true if this party game is being played in party game mode,
@@ -0,0 +1,38 @@
//
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.threerings.parlor.game.data;
import com.threerings.parlor.data.TableConfigurator;
import com.threerings.parlor.util.ParlorContext;
/**
* An interface to be implemented by GameConfigs if they want to be
* able to use Table matchmaking services.
*/
public interface TableableGameConfig
{
/**
* Called when this GameConfig is to be used for Table matchmaking,
* returns the TableConfigurator to be used to configure the Table.
*/
public TableConfigurator createTableConfigurator (ParlorContext ctx);
}
@@ -26,7 +26,7 @@ import com.threerings.parlor.data.TableConfig;
/**
* Provides additional information for games with teams.
*/
public interface TeamGameConfig extends TableConfig
public interface TeamGameConfig
{
/**
* Returns the members of each team. For instance, a game with three