1. Make sure a tile or piecen submitted is submitted by the current turn
holder.
2. Wait to end the turn until after we've received the elementAdded
notification for piecen placement and done the scoring. This ensures that
all events that need to be dispatched before the turn ends are dispatched
and that piecen removal is completed before we end the game and
potentially do more scoring.
3. When scoring a tile, always use an array that we can modify during the
scoring process to ensure that we don't score a claim group twice by
virtue of it being completed by a tile with two of the same feature, both
of which are linked into the same claim group. By removing piecens from
the array immediately, we can tell that we scored a claim group the first
time because the piecens belonging to the claim group will have been
removed from the local array whereas they would not yet have been removed
from the distributed set by virtue of the element removed events not yet
having been dispatched. Distributed programming is tricky.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@437 6335cc39-0255-0410-8fd6-9bcaacd3b74c
group list because that may contain the same tile multiple times when
tiles that contain multiple features are included in a single claim group
with both of their features. So we have to do some extra jockeying to
ensure that we count a tile only once.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@436 6335cc39-0255-0410-8fd6-9bcaacd3b74c
if a piecen is placed on a feature that is already claimed (which happens
when someone shows up halfway through a game and we reconstruct the board
state).
git-svn-id: https://samskivert.googlecode.com/svn/trunk@383 6335cc39-0255-0410-8fd6-9bcaacd3b74c
we enter the game room so that everything starts out in the proper
configuration even if we show up halfway through a game.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@380 6335cc39-0255-0410-8fd6-9bcaacd3b74c
right thing if we had no piecens to place, but our act of placing a tile
freed up one of our piecens for placement.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@371 6335cc39-0255-0410-8fd6-9bcaacd3b74c
claim groups to newly placed tiles and to existing tiles when a piecen is
placed or a tile is placed that joins groups. Whee!
git-svn-id: https://samskivert.googlecode.com/svn/trunk@359 6335cc39-0255-0410-8fd6-9bcaacd3b74c
to finish (ending the game when the last tile is played). Added a turn
indicator view that displays whose turn it is, the tile being placed and
the number of tiles remaining to be played. Added code to create
geometries for each tile which dictates which parts of it are farms, roads
and cities, respectively. These are currently used to render the tiles but
will eventually just be used to identify where the user wants to place
their piecen.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@358 6335cc39-0255-0410-8fd6-9bcaacd3b74c
code to figure out where tiles can legally be placed. Wrote code that
displays a tile for placement on the board and does some neat calculations
to determine the orientation of the tile based on the mouse coordinates
within the tile. It's progress folks. We love progress.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@349 6335cc39-0255-0410-8fd6-9bcaacd3b74c