1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-14 09:09:38 -09:00

additional fixes + some missed files

This commit is contained in:
BetaSteward 2011-02-24 22:02:32 -05:00
parent 1945538041
commit 51a9c03ed1
8 changed files with 224 additions and 4 deletions
Mage.Client
Mage.Server/src/main/java/mage/server
Mage/src/mage/game

View file

@ -0,0 +1,24 @@
NAME:Boros
3 [WWK:20] Stoneforge Mystic
3 [ZEN:195] Adventuring Gear
2 [SOM:94] Koth of the Hammer
4 [ZEN:223] Scalding Tarn
3 [ZEN:14] Journey to Nowhere
4 [ZEN:126] Goblin Guide
1 [M11:232] Plains
2 [M11:233] Plains
4 [M11:149] Lightning Bolt
1 [M11:230] Plains
4 [ZEN:219] Marsh Flats
1 [M11:231] Plains
1 [M11:243] Mountain
2 [M11:242] Mountain
4 [ZEN:36] Steppe Lynx
2 [M11:245] Mountain
1 [M11:244] Mountain
3 [SOM:104] Spikeshot Elder
4 [ZEN:211] Arid Mesa
4 [M11:33] Squadron Hawk
1 [SOM:208] Sword of Body and Mind
2 [M11:229] Terramorphic Expanse
4 [ZEN:141] Plated Geopede

View file

@ -0,0 +1,51 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.client.util;
import java.util.Comparator;
import mage.view.CardView;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CardViewColorComparator implements Comparator<CardView> {
@Override
public int compare(CardView o1, CardView o2) {
int val = o1.getColor().compareTo(o2.getColor());
if (val == 0) {
return o1.getName().compareTo(o2.getName());
}
else {
return val;
}
}
}

View file

@ -0,0 +1,51 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.client.util;
import java.util.Comparator;
import mage.view.CardView;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CardViewCostComparator implements Comparator<CardView> {
@Override
public int compare(CardView o1, CardView o2) {
int val = Integer.valueOf(o1.getConvertedManaCost()).compareTo(Integer.valueOf(o2.getConvertedManaCost()));
if (val == 0) {
return o1.getName().compareTo(o2.getName());
}
else {
return val;
}
}
}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.client.util;
import java.util.Comparator;
import mage.view.CardView;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CardViewNameComparator implements Comparator<CardView> {
@Override
public int compare(CardView o1, CardView o2) {
return o1.getName().compareTo(o2.getName());
}
}

View file

@ -0,0 +1,51 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.client.util;
import java.util.Comparator;
import mage.view.CardView;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CardViewRarityComparator implements Comparator<CardView> {
@Override
public int compare(CardView o1, CardView o2) {
int val = o1.getRarity().compareTo(o2.getRarity());
if (val == 0) {
return o1.getName().compareTo(o2.getName());
}
else {
return val;
}
}
}

View file

@ -369,7 +369,7 @@ public class TableController {
private Game loadGame() {
try{
InputStream file = new FileInputStream("saved/" + match.getGame().toString() + ".game");
InputStream file = new FileInputStream("saved/" + match.getGame().getId().toString() + ".game");
InputStream buffer = new BufferedInputStream(file);
ObjectInput input = new CopierObjectInputStream(Main.classLoader, new GZIPInputStream(buffer));
try {

View file

@ -322,9 +322,6 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
}
protected void init(UUID choosingPlayerId, boolean testMode) {
for (Player player: state.getPlayers().values()) {
player.init(this, testMode);
}
for (Player player: state.getPlayers().values()) {
player.beginTurn(this);
}

View file

@ -124,6 +124,7 @@ public abstract class MatchImpl implements Match {
protected void initGame(Game game) throws GameException {
for (MatchPlayer matchPlayer: this.players) {
matchPlayer.getPlayer().init(game);
game.loadCards(matchPlayer.getDeck().getCards(), matchPlayer.getPlayer().getId());
game.loadCards(matchPlayer.getDeck().getSideboard(), matchPlayer.getPlayer().getId());
game.addPlayer(matchPlayer.getPlayer(), matchPlayer.getDeck());