From: <umg...@us...> - 2007-04-01 17:28:50
|
Revision: 376 http://svn.sourceforge.net/pybridge/?rev=376&view=rev Author: umgangee Date: 2007-04-01 10:28:46 -0700 (Sun, 01 Apr 2007) Log Message: ----------- Provide extra information in interface docstrings, remove ITableEvents. Modified Paths: -------------- trunk/pybridge/pybridge/interfaces/game.py trunk/pybridge/pybridge/interfaces/table.py Modified: trunk/pybridge/pybridge/interfaces/game.py =================================================================== --- trunk/pybridge/pybridge/interfaces/game.py 2007-03-29 20:11:12 UTC (rev 375) +++ trunk/pybridge/pybridge/interfaces/game.py 2007-04-01 17:28:46 UTC (rev 376) @@ -38,7 +38,7 @@ """Returns an object representing the current state of the game. This may be used to export a game to be saved or transmitted. - @return: a state object. + @return: a state object, consumable by setState(). """ @@ -46,7 +46,7 @@ """Overwrites the current game state with the specified state. This may be used to import a saved or transmitted game. - @param state: a state object. + @param state: a state object, as generated by getState(). """ Modified: trunk/pybridge/pybridge/interfaces/table.py =================================================================== --- trunk/pybridge/pybridge/interfaces/table.py 2007-03-29 20:11:12 UTC (rev 375) +++ trunk/pybridge/pybridge/interfaces/table.py 2007-04-01 17:28:46 UTC (rev 376) @@ -20,13 +20,11 @@ class ITable(Interface): - """ITable defines methods which are common to all table implementations. + """ITable defines methods which are common to all table implementations, + which are expected to provide the following services: - A table is the abstraction of "the place where a game is played". - Implementations of ITable are expected to provide the following services: - - Synchronisation of game state between the server and connected clients. - This should be transparent to external code. + This should be transparent to game code. - Functionality shared by all games, such as: @@ -34,6 +32,8 @@ table when all observers have left. - Communication between users. + + A table is the abstraction of "the place where a game is played". """ @@ -65,59 +65,7 @@ or to all observers. @param message: message text string. - @param sender: identifier of sender. - @param recipients: identifiers of recipient observers. + @param sender: user identifier of sender. + @param recipients: user identifiers of recipient observers. """ - - - -class ITableEvents(Interface): - """ITableEvents defines the events which may be generated by ITable. - - """ - - - def observerAdded(self, table, observer): - """Called when an observer is added to the table. - - @param table: reference to table. - @param observer: observer identifier. - """ - - - def observerRemoved(self, table, observer): - """Called when an observer is removed from the table. - - @param table: reference to table. - @param observer: observer identifier. - """ - - - def playerJoined(self, table, player, position): - """Called when a player takes the position. - - @param table: reference to table. - @param player: player identifier. - @param position: position which player takes. - """ - - - def playerLeft(self, table, player, position): - """Called when a player is removed from their position. - - @param table: reference to table. - @param player: player identifier. - @param position: position which player leaves. - """ - - - def messageReceived(self, table, message, sender, recipients): - """Called when a message from sender is received. - - @param table: reference to table. - @param message: message text string. - @param sender: identifier of sender. - @param recipients: identifiers of recipient observers. - """ - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |