Slay some cyclopian variables.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@929 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -84,9 +84,9 @@ public class Deck extends StreamableArrayList
|
|||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
for (var i :int = CardCodes.SPADES; i <= CardCodes.DIAMONDS; i++) {
|
for (var ii :int = CardCodes.SPADES; ii <= CardCodes.DIAMONDS; ii++) {
|
||||||
for (var j :int = 2; j <= CardCodes.ACE; j++) {
|
for (var jj :int = 2; jj <= CardCodes.ACE; jj++) {
|
||||||
add(new Card(j, i));
|
add(new Card(jj, ii));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ public class Hand extends StreamableArrayList
|
|||||||
public function getSuitMemberCount (suit :int) :int
|
public function getSuitMemberCount (suit :int) :int
|
||||||
{
|
{
|
||||||
var members :int = 0;
|
var members :int = 0;
|
||||||
for (var i :int = 0; i < length; i++) {
|
for (var ii :int = 0; ii < length; ii++) {
|
||||||
if ((get(i) as Card).getSuit() == suit) {
|
if ((get(ii) as Card).getSuit() == suit) {
|
||||||
members++;
|
members++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ public class Hand extends StreamableArrayList
|
|||||||
*/
|
*/
|
||||||
public function containsAllCards (cards :Array) :Boolean
|
public function containsAllCards (cards :Array) :Boolean
|
||||||
{
|
{
|
||||||
for (var i :int = 0; i < cards.length; i++) {
|
for (var ii :int = 0; ii < cards.length; ii++) {
|
||||||
if (!contains(cards[i])) {
|
if (!contains(cards[ii])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,8 +84,8 @@ public class Hand extends StreamableArrayList
|
|||||||
*/
|
*/
|
||||||
public function removeAllCards (cards :Array) :void
|
public function removeAllCards (cards :Array) :void
|
||||||
{
|
{
|
||||||
for (var i :int = 0; i < cards.length; i++) {
|
for (var ii :int = 0; ii < cards.length; ii++) {
|
||||||
remove(cards[i]);
|
remove(cards[ii]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,16 +91,16 @@ public class TableItem
|
|||||||
gbc.weightx = 1.0;
|
gbc.weightx = 1.0;
|
||||||
gbc.insets = new Insets(2, 0, 2, 0);
|
gbc.insets = new Insets(2, 0, 2, 0);
|
||||||
_seats = new JButton[bcount];
|
_seats = new JButton[bcount];
|
||||||
for (int i = 0; i < bcount; i++) {
|
for (int ii = 0; ii < bcount; ii++) {
|
||||||
// create the button
|
// create the button
|
||||||
_seats[i] = new JButton(JOIN_LABEL);
|
_seats[ii] = new JButton(JOIN_LABEL);
|
||||||
_seats[i].addActionListener(this);
|
_seats[ii].addActionListener(this);
|
||||||
|
|
||||||
// if we're on the left
|
// if we're on the left
|
||||||
if (i % 2 == 0) {
|
if (ii % 2 == 0) {
|
||||||
// if we're the last seat, then we've got an odd number
|
// if we're the last seat, then we've got an odd number
|
||||||
// and need to center this final seat
|
// and need to center this final seat
|
||||||
if (i == bcount-1) {
|
if (ii == bcount-1) {
|
||||||
gbc.gridwidth = GridBagConstraints.REMAINDER;
|
gbc.gridwidth = GridBagConstraints.REMAINDER;
|
||||||
} else {
|
} else {
|
||||||
gbc.gridwidth = 1;
|
gbc.gridwidth = 1;
|
||||||
@@ -111,16 +111,16 @@ public class TableItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
// adjust the insets of our last element
|
// adjust the insets of our last element
|
||||||
if (i == bcount-1) {
|
if (ii == bcount-1) {
|
||||||
gbc.insets = new Insets(2, 0, 4, 0);
|
gbc.insets = new Insets(2, 0, 4, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// and add the button with the configured constraints
|
// and add the button with the configured constraints
|
||||||
add(_seats[i], gbc);
|
add(_seats[ii], gbc);
|
||||||
|
|
||||||
// if we just added the first button, add the "go" button
|
// if we just added the first button, add the "go" button
|
||||||
// right after it
|
// right after it
|
||||||
if (i == 0) {
|
if (ii == 0) {
|
||||||
_goButton = new JButton("Go");
|
_goButton = new JButton("Go");
|
||||||
_goButton.setActionCommand("go");
|
_goButton.setActionCommand("go");
|
||||||
_goButton.addActionListener(this);
|
_goButton.addActionListener(this);
|
||||||
@@ -147,21 +147,21 @@ public class TableItem
|
|||||||
|
|
||||||
// now enable and label the buttons accordingly
|
// now enable and label the buttons accordingly
|
||||||
int slength = _seats.length;
|
int slength = _seats.length;
|
||||||
for (int i = 0; i < slength; i++) {
|
for (int ii = 0; ii < slength; ii++) {
|
||||||
if (table.players[i] == null) {
|
if (table.players[ii] == null) {
|
||||||
_seats[i].setText(JOIN_LABEL);
|
_seats[ii].setText(JOIN_LABEL);
|
||||||
_seats[i].setEnabled(!isSeated);
|
_seats[ii].setEnabled(!isSeated);
|
||||||
_seats[i].setActionCommand("join");
|
_seats[ii].setActionCommand("join");
|
||||||
|
|
||||||
} else if (table.players[i].equals(_self) &&
|
} else if (table.players[ii].equals(_self) &&
|
||||||
!table.inPlay()) {
|
!table.inPlay()) {
|
||||||
_seats[i].setText(LEAVE_LABEL);
|
_seats[ii].setText(LEAVE_LABEL);
|
||||||
_seats[i].setEnabled(true);
|
_seats[ii].setEnabled(true);
|
||||||
_seats[i].setActionCommand("leave");
|
_seats[ii].setActionCommand("leave");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_seats[i].setText(table.players[i].toString());
|
_seats[ii].setText(table.players[ii].toString());
|
||||||
_seats[i].setEnabled(false);
|
_seats[ii].setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,9 +186,9 @@ public class TableItem
|
|||||||
if (cmd.equals("join")) {
|
if (cmd.equals("join")) {
|
||||||
// figure out what position this button is in
|
// figure out what position this button is in
|
||||||
int position = -1;
|
int position = -1;
|
||||||
for (int i = 0; i < _seats.length; i++) {
|
for (int ii = 0; ii < _seats.length; ii++) {
|
||||||
if (_seats[i] == event.getSource()) {
|
if (_seats[ii] == event.getSource()) {
|
||||||
position = i;
|
position = ii;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,8 +252,8 @@ public class TableListView extends JPanel
|
|||||||
{
|
{
|
||||||
// first check the match list
|
// first check the match list
|
||||||
int ccount = _matchList.getComponentCount();
|
int ccount = _matchList.getComponentCount();
|
||||||
for (int i = 0; i < ccount; i++) {
|
for (int ii = 0; ii < ccount; ii++) {
|
||||||
TableItem child = (TableItem)_matchList.getComponent(i);
|
TableItem child = (TableItem)_matchList.getComponent(ii);
|
||||||
if (child.table.tableId == tableId) {
|
if (child.table.tableId == tableId) {
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
@@ -261,8 +261,8 @@ public class TableListView extends JPanel
|
|||||||
|
|
||||||
// then the inplay list
|
// then the inplay list
|
||||||
ccount = _playList.getComponentCount();
|
ccount = _playList.getComponentCount();
|
||||||
for (int i = 0; i < ccount; i++) {
|
for (int ii = 0; ii < ccount; ii++) {
|
||||||
TableItem child = (TableItem)_playList.getComponent(i);
|
TableItem child = (TableItem)_playList.getComponent(ii);
|
||||||
if (child.table.tableId == tableId) {
|
if (child.table.tableId == tableId) {
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,8 +296,8 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
|
|
||||||
// create the sprites
|
// create the sprites
|
||||||
int size = hand.size();
|
int size = hand.size();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int ii = 0; ii < size; ii++) {
|
||||||
CardSprite cs = new CardSprite(this, hand.get(i));
|
CardSprite cs = new CardSprite(this, hand.get(ii));
|
||||||
_handSprites.add(cs);
|
_handSprites.add(cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,13 +308,13 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
|
|
||||||
// fade them in at proper locations and layers
|
// fade them in at proper locations and layers
|
||||||
long cardDuration = fadeDuration / size;
|
long cardDuration = fadeDuration / size;
|
||||||
for (int i = 0; i < size; i++) {
|
for (int ii = 0; ii < size; ii++) {
|
||||||
CardSprite cs = _handSprites.get(i);
|
CardSprite cs = _handSprites.get(ii);
|
||||||
cs.setLocation(getHandX(size, i), _handLocation.y);
|
cs.setLocation(getHandX(size, ii), _handLocation.y);
|
||||||
cs.setRenderOrder(i);
|
cs.setRenderOrder(ii);
|
||||||
cs.addSpriteObserver(_handSpriteObserver);
|
cs.addSpriteObserver(_handSpriteObserver);
|
||||||
addSprite(cs);
|
addSprite(cs);
|
||||||
cs.fadeIn(i * cardDuration, cardDuration);
|
cs.fadeIn(ii * cardDuration, cardDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure we have the right card sprite active
|
// make sure we have the right card sprite active
|
||||||
@@ -331,7 +331,7 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
{
|
{
|
||||||
// fill hand will null entries to signify unknown cards
|
// fill hand will null entries to signify unknown cards
|
||||||
Hand hand = new Hand();
|
Hand hand = new Hand();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int ii = 0; ii < size; ii++) {
|
||||||
hand.add(null);
|
hand.add(null);
|
||||||
}
|
}
|
||||||
setHand(hand, fadeDuration);
|
setHand(hand, fadeDuration);
|
||||||
@@ -351,9 +351,9 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
|
|
||||||
// set the sprites
|
// set the sprites
|
||||||
int len = Math.min(_handSprites.size(), hand.size());
|
int len = Math.min(_handSprites.size(), hand.size());
|
||||||
for (int i = 0; i < len; i++) {
|
for (int ii = 0; ii < len; ii++) {
|
||||||
CardSprite cs = _handSprites.get(i);
|
CardSprite cs = _handSprites.get(ii);
|
||||||
cs.setCard(hand.get(i));
|
cs.setCard(hand.get(ii));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,9 +425,9 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
{
|
{
|
||||||
// first create the sprites and add them to the list
|
// first create the sprites and add them to the list
|
||||||
CardSprite[] sprites = new CardSprite[cards.length];
|
CardSprite[] sprites = new CardSprite[cards.length];
|
||||||
for (int i = 0; i < cards.length; i++) {
|
for (int ii = 0; ii < cards.length; ii++) {
|
||||||
sprites[i] = new CardSprite(this, cards[i]);
|
sprites[ii] = new CardSprite(this, cards[ii]);
|
||||||
_handSprites.add(sprites[i]);
|
_handSprites.add(sprites[ii]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// settle the hand
|
// settle the hand
|
||||||
@@ -468,10 +468,10 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
public void flyAcross (Card[] cards, Point src, Point dest, long flightDuration,
|
public void flyAcross (Card[] cards, Point src, Point dest, long flightDuration,
|
||||||
long cardDelay, float fadePortion)
|
long cardDelay, float fadePortion)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < cards.length; i++) {
|
for (int ii = 0; ii < cards.length; ii++) {
|
||||||
// add on top of all board sprites
|
// add on top of all board sprites
|
||||||
CardSprite cs = new CardSprite(this, cards[i]);
|
CardSprite cs = new CardSprite(this, cards[ii]);
|
||||||
cs.setRenderOrder(getHighestBoardLayer() + 1 + i);
|
cs.setRenderOrder(getHighestBoardLayer() + 1 + ii);
|
||||||
cs.setLocation(src.x, src.y);
|
cs.setLocation(src.x, src.y);
|
||||||
addSprite(cs);
|
addSprite(cs);
|
||||||
|
|
||||||
@@ -479,8 +479,8 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
Path path;
|
Path path;
|
||||||
long pathDuration;
|
long pathDuration;
|
||||||
LinePath flight = new LinePath(dest, flightDuration);
|
LinePath flight = new LinePath(dest, flightDuration);
|
||||||
if (i > 0) {
|
if (ii > 0) {
|
||||||
long delayDuration = cardDelay * i;
|
long delayDuration = cardDelay * ii;
|
||||||
LinePath delay = new LinePath(src, delayDuration);
|
LinePath delay = new LinePath(src, delayDuration);
|
||||||
path = new PathSequence(delay, flight);
|
path = new PathSequence(delay, flight);
|
||||||
pathDuration = delayDuration + flightDuration;
|
pathDuration = delayDuration + flightDuration;
|
||||||
@@ -626,8 +626,8 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
*/
|
*/
|
||||||
protected CardSprite getCardSprite (List<CardSprite> list, Card card)
|
protected CardSprite getCardSprite (List<CardSprite> list, Card card)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int ii = 0; ii < list.size(); ii++) {
|
||||||
CardSprite cs = list.get(i);
|
CardSprite cs = list.get(ii);
|
||||||
if (card.equals(cs.getCard())) {
|
if (card.equals(cs.getCard())) {
|
||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
@@ -664,16 +664,16 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
|
|
||||||
// Move each card to its proper position (and, optionally, layer)
|
// Move each card to its proper position (and, optionally, layer)
|
||||||
int size = _handSprites.size();
|
int size = _handSprites.size();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int ii = 0; ii < size; ii++) {
|
||||||
CardSprite cs = _handSprites.get(i);
|
CardSprite cs = _handSprites.get(ii);
|
||||||
if (!isManaged(cs)) {
|
if (!isManaged(cs)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (updateLayers) {
|
if (updateLayers) {
|
||||||
cs.setRenderOrder(i);
|
cs.setRenderOrder(ii);
|
||||||
}
|
}
|
||||||
LinePath adjust = new LinePath(
|
LinePath adjust = new LinePath(
|
||||||
new Point(getHandX(size, i), _handLocation.y), adjustDuration);
|
new Point(getHandX(size, ii), _handLocation.y), adjustDuration);
|
||||||
cs.move(adjust);
|
cs.move(adjust);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -697,8 +697,8 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
updateActiveCardSprite();
|
updateActiveCardSprite();
|
||||||
|
|
||||||
int size = _handSprites.size();
|
int size = _handSprites.size();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int ii = 0; ii < size; ii++) {
|
||||||
CardSprite cs = _handSprites.get(i);
|
CardSprite cs = _handSprites.get(ii);
|
||||||
if (!cs.isMoving()) {
|
if (!cs.isMoving()) {
|
||||||
cs.setLocation(cs.getX(), getHandY(cs));
|
cs.setLocation(cs.getX(), getHandY(cs));
|
||||||
}
|
}
|
||||||
@@ -781,8 +781,8 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
|
|
||||||
// lower them just enough
|
// lower them just enough
|
||||||
int size = _boardSprites.size(), adjustment = layer - highest;
|
int size = _boardSprites.size(), adjustment = layer - highest;
|
||||||
for (int i = 0; i < size; i++) {
|
for (int ii = 0; ii < size; ii++) {
|
||||||
CardSprite cs = _boardSprites.get(i);
|
CardSprite cs = _boardSprites.get(ii);
|
||||||
cs.setRenderOrder(cs.getRenderOrder() + adjustment);
|
cs.setRenderOrder(cs.getRenderOrder() + adjustment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -795,8 +795,8 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
// must be at least zero, because that's the lowest number we can push the sprites down to
|
// must be at least zero, because that's the lowest number we can push the sprites down to
|
||||||
// (the layer of the first card in the hand)
|
// (the layer of the first card in the hand)
|
||||||
int size = _boardSprites.size(), highest = 0;
|
int size = _boardSprites.size(), highest = 0;
|
||||||
for (int i = 0; i < size; i++) {
|
for (int ii = 0; ii < size; ii++) {
|
||||||
highest = Math.max(highest, _boardSprites.get(i).getRenderOrder());
|
highest = Math.max(highest, _boardSprites.get(ii).getRenderOrder());
|
||||||
}
|
}
|
||||||
return highest;
|
return highest;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ public class Deck extends StreamableArrayList<Card>
|
|||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
for (int i = SPADES; i <= DIAMONDS; i++) {
|
for (int ii = SPADES; ii <= DIAMONDS; ii++) {
|
||||||
for (int j = 2; j <= ACE; j++) {
|
for (int j = 2; j <= ACE; j++) {
|
||||||
add(new Card(j, i));
|
add(new Card(j, ii));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ public class Hand extends StreamableArrayList<Card>
|
|||||||
@ActionScript(name="containsAllCards")
|
@ActionScript(name="containsAllCards")
|
||||||
public boolean containsAll (Card[] cards)
|
public boolean containsAll (Card[] cards)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < cards.length; i++) {
|
for (int ii = 0; ii < cards.length; ii++) {
|
||||||
if (!contains(cards[i])) {
|
if (!contains(cards[ii])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,8 +76,8 @@ public class Hand extends StreamableArrayList<Card>
|
|||||||
public int getSuitMemberCount (int suit)
|
public int getSuitMemberCount (int suit)
|
||||||
{
|
{
|
||||||
int len = size(), members = 0;
|
int len = size(), members = 0;
|
||||||
for (int i = 0; i < len; i++) {
|
for (int ii = 0; ii < len; ii++) {
|
||||||
if (get(i).getSuit() == suit) {
|
if (get(ii).getSuit() == suit) {
|
||||||
members++;
|
members++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ public class CardGameManager extends GameManager
|
|||||||
} else {
|
} else {
|
||||||
Hand[] hands = new Hand[_playerCount];
|
Hand[] hands = new Hand[_playerCount];
|
||||||
|
|
||||||
for (int i=0;i<_playerCount;i++) {
|
for (int ii = 0; ii < _playerCount; ii++) {
|
||||||
hands[i] = dealHand(deck, size, i);
|
hands[ii] = dealHand(deck, size, ii);
|
||||||
}
|
}
|
||||||
|
|
||||||
return hands;
|
return hands;
|
||||||
@@ -153,7 +153,7 @@ public class CardGameManager extends GameManager
|
|||||||
int[] oids = (_gameobj.state == GameObject.GAME_OVER) ? _oldPlayerOids : _playerOids;
|
int[] oids = (_gameobj.state == GameObject.GAME_OVER) ? _oldPlayerOids : _playerOids;
|
||||||
int oid = client.getOid();
|
int oid = client.getOid();
|
||||||
|
|
||||||
for (int ii=0; ii < oids.length; ii++) {
|
for (int ii = 0; ii < oids.length; ii++) {
|
||||||
if (oids[ii] == oid) {
|
if (oids[ii] == oid) {
|
||||||
return ii;
|
return ii;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -453,8 +453,8 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
|
|||||||
protected Card pickRandomPlayableCard (Hand hand)
|
protected Card pickRandomPlayableCard (Hand hand)
|
||||||
{
|
{
|
||||||
List<Card> playableCards = Lists.newArrayList();
|
List<Card> playableCards = Lists.newArrayList();
|
||||||
for (int i = 0; i < hand.size(); i++) {
|
for (int ii = 0; ii < hand.size(); ii++) {
|
||||||
Card card = hand.get(i);
|
Card card = hand.get(ii);
|
||||||
if (_trickCardGame.isCardPlayable(hand, card)) {
|
if (_trickCardGame.isCardPlayable(hand, card)) {
|
||||||
playableCards.add(card);
|
playableCards.add(card);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ public class TrickCardGameUtil
|
|||||||
public static PlayerCard getHighestInLeadSuit (PlayerCard[] cardsPlayed, int trumpSuit)
|
public static PlayerCard getHighestInLeadSuit (PlayerCard[] cardsPlayed, int trumpSuit)
|
||||||
{
|
{
|
||||||
PlayerCard highest = cardsPlayed[0];
|
PlayerCard highest = cardsPlayed[0];
|
||||||
for (int i = 1; i < cardsPlayed.length; i++) {
|
for (int ii = 1; ii < cardsPlayed.length; ii++) {
|
||||||
PlayerCard other = cardsPlayed[i];
|
PlayerCard other = cardsPlayed[ii];
|
||||||
if ((other.card.getSuit() == highest.card.getSuit() &&
|
if ((other.card.getSuit() == highest.card.getSuit() &&
|
||||||
other.card.compareTo(highest.card) > 0) ||
|
other.card.compareTo(highest.card) > 0) ||
|
||||||
(other.card.getSuit() == trumpSuit && highest.card.getSuit() != trumpSuit)) {
|
(other.card.getSuit() == trumpSuit && highest.card.getSuit() != trumpSuit)) {
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ public class ParlorDirector extends BasicDirector
|
|||||||
|
|
||||||
// see what our observers have to say about it
|
// see what our observers have to say about it
|
||||||
boolean handled = false;
|
boolean handled = false;
|
||||||
for (int i = 0; i < _grobs.size(); i++) {
|
for (int ii = 0; ii < _grobs.size(); ii++) {
|
||||||
GameReadyObserver grob = _grobs.get(i);
|
GameReadyObserver grob = _grobs.get(ii);
|
||||||
handled = grob.receivedGameReady(gameOid) || handled;
|
handled = grob.receivedGameReady(gameOid) || handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -287,9 +287,9 @@ public class Table
|
|||||||
public boolean clearPlayer (Name username)
|
public boolean clearPlayer (Name username)
|
||||||
{
|
{
|
||||||
if (players != null) {
|
if (players != null) {
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int ii = 0; ii < players.length; ii++) {
|
||||||
if (username.equals(players[i])) {
|
if (username.equals(players[ii])) {
|
||||||
clearPlayerPos(i);
|
clearPlayerPos(ii);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,9 +308,9 @@ public class Table
|
|||||||
public boolean clearPlayerByOid (int bodyOid)
|
public boolean clearPlayerByOid (int bodyOid)
|
||||||
{
|
{
|
||||||
if (bodyOids != null) {
|
if (bodyOids != null) {
|
||||||
for (int i = 0; i < bodyOids.length; i++) {
|
for (int ii = 0; ii < bodyOids.length; ii++) {
|
||||||
if (bodyOid == bodyOids[i]) {
|
if (bodyOid == bodyOids[ii]) {
|
||||||
clearPlayerPos(i);
|
clearPlayerPos(ii);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,9 +143,9 @@ public class PlacementConstraints
|
|||||||
ObjectInfo[] removed)
|
ObjectInfo[] removed)
|
||||||
{
|
{
|
||||||
ObjectData[] addedData = new ObjectData[added.length];
|
ObjectData[] addedData = new ObjectData[added.length];
|
||||||
for (int i = 0; i < added.length; i++) {
|
for (int ii = 0; ii < added.length; ii++) {
|
||||||
addedData[i] = createObjectData(added[i]);
|
addedData[ii] = createObjectData(added[ii]);
|
||||||
if (addedData[i] == null) {
|
if (addedData[ii] == null) {
|
||||||
return INTERNAL_ERROR;
|
return INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -193,33 +193,33 @@ public class PlacementConstraints
|
|||||||
{
|
{
|
||||||
DirectionType dirtype = new DirectionType();
|
DirectionType dirtype = new DirectionType();
|
||||||
|
|
||||||
for (int i = 0; i < added.length; i++) {
|
for (int ii = 0; ii < added.length; ii++) {
|
||||||
if (added[i].tile.hasConstraint(ObjectTileSet.ON_SURFACE) &&
|
if (added[ii].tile.hasConstraint(ObjectTileSet.ON_SURFACE) &&
|
||||||
!isOnSurface(added[i], added, removed)) {
|
!isOnSurface(added[ii], added, removed)) {
|
||||||
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
||||||
"m.not_on_surface");
|
"m.not_on_surface");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getConstraintDirectionType(added[i], ObjectTileSet.ON_WALL,
|
if (getConstraintDirectionType(added[ii], ObjectTileSet.ON_WALL,
|
||||||
dirtype) && !isOnWall(added[i], added, removed, dirtype.dir, dirtype.type)) {
|
dirtype) && !isOnWall(added[ii], added, removed, dirtype.dir, dirtype.type)) {
|
||||||
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
||||||
"m.not_on_wall");
|
"m.not_on_wall");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getConstraintDirectionType(added[i], ObjectTileSet.ATTACH,
|
if (getConstraintDirectionType(added[ii], ObjectTileSet.ATTACH,
|
||||||
dirtype) && !isAttached(added[i], added, removed,
|
dirtype) && !isAttached(added[ii], added, removed,
|
||||||
dirtype.dir, dirtype.type)) {
|
dirtype.dir, dirtype.type)) {
|
||||||
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
||||||
"m.not_attached");
|
"m.not_attached");
|
||||||
}
|
}
|
||||||
|
|
||||||
int dir = getConstraintDirection(added[i], ObjectTileSet.SPACE);
|
int dir = getConstraintDirection(added[ii], ObjectTileSet.SPACE);
|
||||||
if (dir != NONE && !hasSpace(added[i], added, removed, dir)) {
|
if (dir != NONE && !hasSpace(added[ii], added, removed, dir)) {
|
||||||
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
||||||
"m.no_space");
|
"m.no_space");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasSpaceConstrainedAdjacent(added[i], added, removed)) {
|
if (hasSpaceConstrainedAdjacent(added[ii], added, removed)) {
|
||||||
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
return MessageBundle.qualify(STAGE_MESSAGE_BUNDLE,
|
||||||
"m.no_space_adj");
|
"m.no_space_adj");
|
||||||
}
|
}
|
||||||
@@ -256,8 +256,8 @@ public class PlacementConstraints
|
|||||||
ObjectData[] removed)
|
ObjectData[] removed)
|
||||||
{
|
{
|
||||||
List<ObjectData> objects = getObjectData(data.bounds, added, removed);
|
List<ObjectData> objects = getObjectData(data.bounds, added, removed);
|
||||||
for (int i = 0, size = objects.size(); i < size; i++) {
|
for (int ii = 0, size = objects.size(); ii < size; ii++) {
|
||||||
ObjectData odata = objects.get(i);
|
ObjectData odata = objects.get(ii);
|
||||||
if (odata.tile.hasConstraint(ObjectTileSet.ON_SURFACE) &&
|
if (odata.tile.hasConstraint(ObjectTileSet.ON_SURFACE) &&
|
||||||
!isOnSurface(odata, added, removed)) {
|
!isOnSurface(odata, added, removed)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -276,8 +276,8 @@ public class PlacementConstraints
|
|||||||
DirectionType dirtype = new DirectionType();
|
DirectionType dirtype = new DirectionType();
|
||||||
|
|
||||||
List<ObjectData> objects = getObjectData(data.bounds, added, removed);
|
List<ObjectData> objects = getObjectData(data.bounds, added, removed);
|
||||||
for (int i = 0, size = objects.size(); i < size; i++) {
|
for (int ii = 0, size = objects.size(); ii < size; ii++) {
|
||||||
ObjectData odata = objects.get(i);
|
ObjectData odata = objects.get(ii);
|
||||||
if (getConstraintDirectionType(odata, ObjectTileSet.ON_WALL,
|
if (getConstraintDirectionType(odata, ObjectTileSet.ON_WALL,
|
||||||
dirtype) && !isAttached(odata, added, removed,
|
dirtype) && !isAttached(odata, added, removed,
|
||||||
dirtype.dir, dirtype.type)) {
|
dirtype.dir, dirtype.type)) {
|
||||||
@@ -298,8 +298,8 @@ public class PlacementConstraints
|
|||||||
|
|
||||||
List<ObjectData> objects = getObjectData(getAdjacentEdge(data.bounds,
|
List<ObjectData> objects = getObjectData(getAdjacentEdge(data.bounds,
|
||||||
DirectionUtil.getOpposite(dir)), added, removed);
|
DirectionUtil.getOpposite(dir)), added, removed);
|
||||||
for (int i = 0, size = objects.size(); i < size; i++) {
|
for (int ii = 0, size = objects.size(); ii < size; ii++) {
|
||||||
ObjectData odata = objects.get(i);
|
ObjectData odata = objects.get(ii);
|
||||||
if (getConstraintDirectionType(odata, ObjectTileSet.ATTACH,
|
if (getConstraintDirectionType(odata, ObjectTileSet.ATTACH,
|
||||||
dirtype) && !isAttached(odata, added, removed,
|
dirtype) && !isAttached(odata, added, removed,
|
||||||
dirtype.dir, dirtype.type)) {
|
dirtype.dir, dirtype.type)) {
|
||||||
@@ -321,8 +321,8 @@ public class PlacementConstraints
|
|||||||
_constrainRect.setBounds(r.x - 1, r.y - 1, r.width + 2, r.height + 2);
|
_constrainRect.setBounds(r.x - 1, r.y - 1, r.width + 2, r.height + 2);
|
||||||
|
|
||||||
List<ObjectData> objects = getObjectData(_constrainRect, added, removed);
|
List<ObjectData> objects = getObjectData(_constrainRect, added, removed);
|
||||||
for (int i = 0, size = objects.size(); i < size; i++) {
|
for (int ii = 0, size = objects.size(); ii < size; ii++) {
|
||||||
ObjectData odata = objects.get(i);
|
ObjectData odata = objects.get(ii);
|
||||||
int dir = getConstraintDirection(odata, ObjectTileSet.SPACE);
|
int dir = getConstraintDirection(odata, ObjectTileSet.SPACE);
|
||||||
if (dir != NONE && !hasSpace(odata, added, removed, dir)) {
|
if (dir != NONE && !hasSpace(odata, added, removed, dir)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -389,8 +389,8 @@ public class PlacementConstraints
|
|||||||
for (int y = rect.y, ymax = rect.y + rect.height; y < ymax; y++) {
|
for (int y = rect.y, ymax = rect.y + rect.height; y < ymax; y++) {
|
||||||
for (int x = rect.x, xmax = rect.x + rect.width; x < xmax; x++) {
|
for (int x = rect.x, xmax = rect.x + rect.width; x < xmax; x++) {
|
||||||
boolean covered = false;
|
boolean covered = false;
|
||||||
for (int i = 0, size = objects.size(); i < size; i++) {
|
for (int ii = 0, size = objects.size(); ii < size; ii++) {
|
||||||
ObjectData data = objects.get(i);
|
ObjectData data = objects.get(ii);
|
||||||
if (data.bounds.contains(x, y) && (constraint == null ||
|
if (data.bounds.contains(x, y) && (constraint == null ||
|
||||||
data.tile.hasConstraint(constraint) ||
|
data.tile.hasConstraint(constraint) ||
|
||||||
(altstraint != null &&
|
(altstraint != null &&
|
||||||
|
|||||||
@@ -114,12 +114,11 @@ public abstract class SpotSceneRuleSet implements NestableRuleSet
|
|||||||
Location loc = portal.loc;
|
Location loc = portal.loc;
|
||||||
Class<?> locClass = loc.getClass();
|
Class<?> locClass = loc.getClass();
|
||||||
|
|
||||||
// iterate over the attributes, setting public fields where
|
// iterate over the attributes, setting public fields where applicable
|
||||||
// applicable
|
for (int ii = 0; ii < attrs.getLength(); ii++) {
|
||||||
for (int i = 0; i < attrs.getLength(); i++) {
|
String lname = attrs.getLocalName(ii);
|
||||||
String lname = attrs.getLocalName(i);
|
|
||||||
if (StringUtil.isBlank(lname)) {
|
if (StringUtil.isBlank(lname)) {
|
||||||
lname = attrs.getQName(i);
|
lname = attrs.getQName(ii);
|
||||||
}
|
}
|
||||||
|
|
||||||
// look for a public field with this lname
|
// look for a public field with this lname
|
||||||
@@ -145,7 +144,7 @@ public abstract class SpotSceneRuleSet implements NestableRuleSet
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert the value into the appropriate object type
|
// convert the value into the appropriate object type
|
||||||
String valstr = attrs.getValue(i);
|
String valstr = attrs.getValue(ii);
|
||||||
// use the value marshaller to parse the
|
// use the value marshaller to parse the
|
||||||
// property based on the type of the target object field
|
// property based on the type of the target object field
|
||||||
Object value = ValueMarshaller.unmarshal(
|
Object value = ValueMarshaller.unmarshal(
|
||||||
|
|||||||
Reference in New Issue
Block a user