Commit Graph

326 Commits

Author SHA1 Message Date
Michael Bayne da4e12771f A few twiddlings:
- set up the playerStatus array before gameWillStart() so that we can properly
  note players that abandon ship before the game is going;
- fixed some raw collection usage;
- fixed some assumptions about IN_PLAY being the only state that means a game
  is in play.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4127 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-19 01:56:54 +00:00
Mike Thomas e2057d362d Add overridable function to potentially allow games to start up even without any humans present if they wish. Defaults to NOT allow that behavior.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4076 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-28 20:40:04 +00:00
Mark Johnson 3cd66e17ad If everyone leaves, but the game was in play, put the game into game
over state, not cancelled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4069 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-27 02:33:04 +00:00
Mike Thomas c313fb63b9 I'm about to commit a fix so that this doesn't happen anymore... but if it does, I want to see it in the logs...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4053 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-25 00:49:58 +00:00
Michael Bayne d2f61ad735 Revamped game cancellation handling a bit and modified handlePartialNoShow() to
cancel rather than start a game if zero humans showed up.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4049 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-24 02:34:31 +00:00
Michael Bayne fdf0fa27d3 Revamped PlaceConfig to instantiate the PlaceController directly instead of
looking it up by name which creates PITA when we want to obfuscate and strip
out unused code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4026 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-18 01:32:41 +00:00
Michael Bayne 2cc2e5fd00 Made it possible to make extended use of the playerStatus array.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3994 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-02 18:39:25 +00:00
Michael Bayne 196799d842 Wrapped long line.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3941 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-14 02:20:40 +00:00
Michael Bayne 58cbfb6db1 Regenerated using the new Ant-task-based generator.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3914 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-06 21:51:59 +00:00
Ray Greenwell 47f0772412 Protect against NPE if we try to send cards to an absent player.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3829 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-02-03 19:11:20 +00:00
Ray Greenwell 2f611366d9 Send the oid of the applicable game with the Hand.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3828 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-02-03 19:09:49 +00:00
Mike Thomas dfc8112277 Split out fading sprite capability from the CardSprite class so it can be extended and used elsewhere.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3819 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-24 19:46:34 +00:00
Ray Greenwell b994d709d3 A possible fix for someone who is having problems with the card flipping:
http://forums.puzzlepirates.com/community/mvnforum/viewthread?thread=30539&firstunread=yes


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3815 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-20 01:25:05 +00:00
Ray Greenwell 96f017fc3e Added getCards() convenience method.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3813 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-19 21:50:53 +00:00
Ray Greenwell e2cfd1de80 Added getPartyGameType, similar to the method in PartyGameConfig.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3808 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-18 22:15:05 +00:00
Ray Greenwell d67825b213 Provide an easy way to add to toString() info.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3806 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-17 23:28:21 +00:00
Ray Greenwell 7f98cac7a8 - Revamped PartyGameConfig so that it can report which type of party game
it is (seated or free-for-all) or if it's not a party game after all
  (which the old interface supported and we may need in the future).
- Cleaned up the setting of table occupants to make the extension in yohoho
  cleaner.
- tables are now party-game aware and will do the right thing with
  the occupants list.
- simplified Table.equals() and added a corresponding hashCode(), because
  two objects that are equals() must give the same hashCode.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3804 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-13 01:52:36 +00:00
Mike Thomas bf45bb876e Added ability for card sprites to be flipped to reveal a different card's image (such as from the card-back to a front). This is done by gradually scaling horizontally to no width, then scaling back up with the new image.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3803 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-09 21:45:06 +00:00
Ray Greenwell 852620bea4 Regenerated marshallers with new response-tracking code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3793 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-21 02:12:57 +00:00
Mike Thomas fac90ce23d Split out announcement of a player elimination to its own function so we can override it for games where normal announcement doesn't make sense.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3790 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-21 00:52:30 +00:00
Michael Bayne 5225eb2a43 Changed handleStateChange() to stateDidChange() to be more consistent with
gameDidStart(), etc. and with the new GameManager.stateDidChange().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3789 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-20 21:01:36 +00:00
Michael Bayne c7d36f9705 Changed AWAITING_PLAYERS to PRE_GAME; factored some code into stateDidChange().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3787 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-20 01:45:02 +00:00
Mike Thomas 04c13820ef Added ability to override hand-sorting on the card panel.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3778 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-08 19:41:12 +00:00
Mike Thomas 15ea2134e3 New type of CardSprite using the micro-card images.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3773 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-03 00:37:30 +00:00
Michael Bayne 176329e1ed Various updates to allow a system where a user's visible name is not the same
as their authentication name (which we leave in BodyObject.username). This
turns out to be simpler than the system we adopted for Yohoho wherein we
replace the player's user object after they select a character, but converting
to this sort of system is way more work than would be worth it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3758 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-11-10 23:18:58 +00:00
Ray Greenwell 263a36e23e Allow a TableConfig to be set prior to initialization.
The configurator will use that as its prototype, and attempt to configure
the UI elements to display the values in that config.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3755 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-11-10 01:19:37 +00:00
Ray Greenwell 18833d7eb7 Added an isPrivate variable to GameObject.
Set it if a table game is created as being private.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3738 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-10-20 07:17:02 +00:00
Michael Bayne dd2468b140 Javadoc tidying up.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3725 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-10-08 22:21:19 +00:00
Michael Bayne f32b2de490 Enumerated legacy services which have class-based providers and regenerated
those that do not using the template.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3716 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-27 23:09:45 +00:00
Andrzej Kapolka 4fbb911d7c Use a sublist view rather than removing and adding cards one by one.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3713 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-27 21:58:10 +00:00
Ray Greenwell 277af53513 We shouldn't be using OidLists to report winners/losers/players knocked out.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3711 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-27 01:50:29 +00:00
Ray Greenwell ede0d9f471 Broke out sending the player-ready signal to the server into a method
so that it can easily be overridden.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3709 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-23 02:00:52 +00:00
Michael Bayne 88e72fbbf6 Call endPlayerGame() before we finish the bodyLeft() processing because if the
leaving player was the last human player in the room, bodyLeft() will result in
a call to placeBecameEmpty() which will shut the game manager down before it
has a chance to end the game cleanly as a result of said player leaving.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3708 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-22 19:52:58 +00:00
Michael Bayne f79a52142c Nomenclature fix: puzzle -> game.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3701 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-09 00:42:34 +00:00
Michael Bayne 738cf657cb Allow a player to be replaced in an in-play game; properly handle the case
in a turn-based game where the turn holder is replaced and update the
turnHolder field in a way that doesn't cause the client to think that the
turn changed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3667 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-08-03 07:46:54 +00:00
Michael Bayne 595df9ee28 Which game you talkin' 'bout Willis?
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3641 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-05 17:39:48 +00:00
Ray Greenwell b603e6b051 More stuff with ending player games:
- If a player leaves, handle the ending of their game in GameManager.
- don't start the turn first turn in turn-based games on a missing player
- Let derived classes get playerGameDidEnd() even if the game doesn't
  have statuses.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3640 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-01 23:56:54 +00:00
Elizabeth Fong e1338dca1e partial fix to 'logged off players automatically win all matches in tourneys'
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3639 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-01 00:50:13 +00:00
Ray Greenwell 80ac008f24 Prevent array index bounds problems if isOccupiedPlayer gets called
with -1 (I saw it happen entering a sword game as a watcher).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3613 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-22 19:59:51 +00:00
Ray Greenwell 681561c4bf Removed backwards compatability with things that don't understand
that we're using a grid bag layout and they should use addControl().
Toybox is updated, and if there's anything else out there it's going
to need to be updated anyway, because it likely extends GameConfigurator
directly which is no longer a component.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3611 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-22 18:43:43 +00:00
Ray Greenwell 42aaf9d64d Moved team game configuration stuff into the TableConfig, added
a method in Table to return the compressed team indices, added
a new TeamGameManager which can be implemented to have the final
team info communicated to the game manager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3604 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-17 20:25:28 +00:00
Ray Greenwell 6ce0059b29 Removed special "party" crap related to starting a game after it's
been created. A party game starts itself without direct user intervention.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3600 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-15 23:46:31 +00:00
Ray Greenwell 97b1085388 Added support for minimumPlayerCount, allowing tables to be started
before they're full.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3597 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-13 23:47:48 +00:00
Ray Greenwell 8bec395301 Updated documentation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3596 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-13 18:52:33 +00:00
Ray Greenwell cf5b889be6 The continuing refactor.
- GameConfigurators are no longer JPanels, but rather abstract classes
  that show UI in their own way. There is a SwingGameConfigurator that
  has a panel.
- TableConfigurator is no longer an interface, but is now more closely
  like the GameConfigurator.
- Repackaged some things that were in the wrong place.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3593 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-10 18:10:49 +00:00
Ray Greenwell b209ee036d Beginnings of a new unified way of configuring not only puzzles but
associated options depending on the context of the puzzle, for example
the wager, or tournament options. Kept the default layout as a vgroup
for backwards compatability (although I think the only thing that needs
that is the ToyBoxConfigurator, and I've been wanting to make that bad
boy line up nicely for a while now, so this backwards compatible stuff
will only be needed for a short while).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3590 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-08 23:20:18 +00:00
Ray Greenwell a5844db478 Rather that returning a String[] description, return a List.
Subclasses can now easily add their own descriptions on to the beginning
or end of their superclass's descriptions without having to do the
hokey pokey.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3570 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-23 23:17:24 +00:00
Andrzej Kapolka a40de2ec51 Permit changing media render order as long as we're not in a tick. Removes the need to remove and re-add sprites, which was cancelling their paths.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3551 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-13 22:22:56 +00:00
Ted V c5024298fc Fixme was fixed implicitly a while back; just cleaning up comments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3547 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-12 18:51:57 +00:00
Ted V 64de3f4368 Player status is now initialized for all games. (And yes, I tested
that initBoard didn't generate some exceptions now that the player
status initialization occurs after board summary initialization.  This
occurs in sword fighting and old drinking, for the record.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3546 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-12 00:51:11 +00:00