[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pbmserv-dev] SequentialMoves() / !SequentialMoves() question
I've got a situation I'm not sure how to handle, maybe someone has an idea.
In the game of hearts, all players first choose 3 cards to pass to the
"right", then whoever has the two of clubs goes first. I've got the game
coded so the first "round" is !SequentialMoves(). The problem is, once all
players have submitted their moves and the cards are passed in
ProcessRound(), how to get the player who has the two of clubs to move
first.
I was going to have PrepareMove() insert SkipMove() moves up to the player
with the two of clubs when the last player submits their pass cards move.
But, at that point, when PrepareMove() is called, the syncmoves have not yet
been copied to moves, so adding additional SkipMove() moves doesn't work.
I was also looking into using ForceMove() to force the skip until the player
with the two of clubs is reached. The problem with this is, when the last
player submits their pass move, ForceMove() is not called.
One thing I was thinking about would be to rearrange the player order at the
end of ProcessRound() (where all the cards are actually passed) so that the
player with the two of clubs is first in the players list -- but I would
have to rearrange all the other player-order based lists as well. This isn't
hard, but I don't know what other side effects it might have.
I guess my last resort would be to not use !SequentialMoves() and just have
all players pass cards in order as their first move.
Does anyone have any better ideas how to handle this sitatuin? Thanks.
- Bob