* Changed logging level back to info, changed level of a lot of messages to debug from info. Added check that certain AI players can't join a table with no appropriate format.

This commit is contained in:
LevelX2 2013-10-09 15:22:40 +02:00
parent 7a4469fd80
commit d34779fa68
26 changed files with 146 additions and 69 deletions

View file

@ -77,4 +77,7 @@ public interface Tournament {
// tournament times
Date getStartTime();
Date getEndTime();
// tournament type
TournamentType getTournamentType();
void setTournamentType(TournamentType tournamentType);
}

View file

@ -52,6 +52,7 @@ public abstract class TournamentImpl implements Tournament {
protected static Random rnd = new Random();
protected String matchName;
protected TournamentOptions options;
protected TournamentType tournamentType;
protected List<ExpansionSet> sets = new ArrayList<ExpansionSet>();
protected String setsInfoShort;
@ -332,4 +333,14 @@ public abstract class TournamentImpl implements Tournament {
return new Date(endTime.getTime());
}
@Override
public TournamentType getTournamentType() {
return tournamentType;
}
@Override
public void setTournamentType(TournamentType tournamentType) {
this.tournamentType = tournamentType;
}
}

View file

@ -40,7 +40,7 @@ import mage.game.match.MatchOptions;
public class TournamentOptions implements Serializable {
protected String name;
protected String tournamentType;
protected String tournamentType;;
protected List<String> playerTypes = new ArrayList<String>();
protected MatchOptions matchOptions = new MatchOptions("", "Two Player Duel");
protected LimitedOptions limitedOptions;

View file

@ -28,19 +28,32 @@
package mage.players;
import mage.constants.Outcome;
import mage.constants.RangeOfInfluence;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mage.MageItem;
import mage.MageObject;
import mage.abilities.*;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.ActivatedAbility;
import mage.abilities.Mode;
import mage.abilities.Modes;
import mage.abilities.SpellAbility;
import mage.abilities.TriggeredAbility;
import mage.abilities.costs.mana.ManaCost;
import mage.cards.Card;
import mage.cards.Cards;
import mage.cards.decks.Deck;
import mage.choices.Choice;
import mage.constants.Outcome;
import mage.constants.RangeOfInfluence;
import mage.counters.Counter;
import mage.counters.Counters;
import mage.game.Game;
import mage.game.Table;
import mage.game.draft.Draft;
import mage.game.match.Match;
import mage.game.permanent.Permanent;
@ -52,9 +65,6 @@ import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
import mage.util.Copyable;
import java.io.Serializable;
import java.util.*;
/**
*
* @author BetaSteward_at_googlemail.com
@ -322,4 +332,11 @@ public interface Player extends MageItem, Copyable<Player> {
void setReachedNextTurnAfterLeaving(boolean reachedNextTurnAfterLeaving);
boolean hasReachedNextTurnAfterLeaving();
/**
* Checks if a AI player is able to join a table
* i.e. Draft - bot can not enter a table with constructed format
* @param table
* @return
*/
boolean canJoinTable(Table table);
}

View file

@ -91,6 +91,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.Table;
import mage.game.combat.CombatGroup;
import mage.game.events.DamagePlayerEvent;
import mage.game.events.DamagedPlayerEvent;
@ -2027,5 +2028,9 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
public boolean hasReachedNextTurnAfterLeaving() {
return reachedNextTurnAfterLeaving;
}
@Override
public boolean canJoinTable(Table table) {
return true;
}
}