Refactored Z's last change slightly, eliminated code duplication.

This commit is contained in:
wrenczes@gmail.com
2011-02-05 21:30:28 +00:00
parent a01898436b
commit bb2f784489
+3 -10
View File
@@ -68,22 +68,15 @@ void GuiPlay::HorzStack::Enstack(CardView* card)
void GuiPlay::VertStack::Enstack(CardView* card) void GuiPlay::VertStack::Enstack(CardView* card)
{ {
if(total < 10) int modulus = total < 10 ? 3 : 5;
{ {
if (0 == count % 3) if (0 == count % modulus)
{
x += CARD_WIDTH;
y = 0;
}
}
else
{
if (0 == count % 5)
{ {
x += CARD_WIDTH; x += CARD_WIDTH;
y = 0; y = 0;
} }
} }
card->x = x + baseX; card->x = x + baseX;
card->y = y + baseY; card->y = y + baseY;
y += 12; y += 12;