]> git.cworth.org Git - empires-server/commit
game: Allow either player to play the first move
authorCarl Worth <cworth@cworth.org>
Fri, 5 Jun 2020 23:18:57 +0000 (16:18 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 5 Jun 2020 23:18:57 +0000 (16:18 -0700)
commit76232144e294f384cde30933687de514fd90584a
treed65d64856eb3118e1e4865769a205499faee45f5
parent756dc24a56a1da12d01025d7ebdef88ac7ea3471
game: Allow either player to play the first move

When players originally join the game they do not belong on any
team. And while we could require the players to divide themselves up
and join separate teams, it's much easier for them if they aren't
required to coordinate on that.

So, with this commit we allow any player, (not yet in a team), to make
the first move. At that point, we assign that player the appropriate
team for playing first, and assign at least one player (if there are
others in the game) to each successive team value in the order they
originally joined the game.

This means that in the common case of a 2-player game, if both players
are in the game, and one player makes a move, then the two players
will be assigned to separate teams.
game.js
lmno.js
test