Made the clearOccupant methods maximally overrideable.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3457 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -203,8 +203,7 @@ public class Table
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < occupants.length; i++) {
|
for (int i = 0; i < occupants.length; i++) {
|
||||||
if (username.equals(occupants[i])) {
|
if (username.equals(occupants[i])) {
|
||||||
occupants[i] = null;
|
clearOccupantPos(i);
|
||||||
bodyOids[i] = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,14 +222,23 @@ public class Table
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < bodyOids.length; i++) {
|
for (int i = 0; i < bodyOids.length; i++) {
|
||||||
if (bodyOid == bodyOids[i]) {
|
if (bodyOid == bodyOids[i]) {
|
||||||
occupants[i] = null;
|
clearOccupantPos(i);
|
||||||
bodyOids[i] = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal method used for clearing an occupant once we've located
|
||||||
|
* the right position.
|
||||||
|
*/
|
||||||
|
protected void clearOccupantPos (int position)
|
||||||
|
{
|
||||||
|
occupants[position] = null;
|
||||||
|
bodyOids[position] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this table has a sufficient number of occupants
|
* Returns true if this table has a sufficient number of occupants
|
||||||
* that the game can be started.
|
* that the game can be started.
|
||||||
|
|||||||
Reference in New Issue
Block a user