2011-10-08 22:03:44 +02:00
|
|
|
package com.massivecraft.factions.zcore;
|
|
|
|
|
2014-11-13 20:49:13 +01:00
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.Faction;
|
|
|
|
import com.massivecraft.factions.P;
|
|
|
|
import com.massivecraft.factions.integration.Econ;
|
2014-12-08 00:12:52 +01:00
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
2014-04-04 20:55:21 +02:00
|
|
|
import com.massivecraft.factions.zcore.util.TextUtil;
|
2014-12-08 00:12:52 +01:00
|
|
|
|
2014-11-13 19:45:57 +01:00
|
|
|
import mkremins.fanciful.FancyMessage;
|
2014-12-08 00:12:52 +01:00
|
|
|
|
2014-11-13 20:49:13 +01:00
|
|
|
import org.apache.commons.lang.time.DurationFormatUtils;
|
2011-10-08 22:03:44 +02:00
|
|
|
import org.bukkit.Bukkit;
|
2014-11-13 20:49:13 +01:00
|
|
|
import org.bukkit.ChatColor;
|
2011-10-08 22:03:44 +02:00
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map.Entry;
|
|
|
|
|
|
|
|
|
|
|
|
public abstract class MCommand<T extends MPlugin> {
|
2014-08-05 17:17:27 +02:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public T p;
|
|
|
|
|
|
|
|
// The sub-commands to this command
|
|
|
|
public List<MCommand<?>> subCommands;
|
|
|
|
|
|
|
|
public void addSubCommand(MCommand<?> subCommand) {
|
2014-07-01 22:10:18 +02:00
|
|
|
subCommand.commandChain.addAll(this.commandChain);
|
|
|
|
subCommand.commandChain.add(this);
|
2014-04-04 20:55:21 +02:00
|
|
|
this.subCommands.add(subCommand);
|
|
|
|
}
|
|
|
|
|
|
|
|
// The different names this commands will react to
|
|
|
|
public List<String> aliases;
|
|
|
|
public boolean allowNoSlashAccess;
|
|
|
|
|
|
|
|
// Information on the args
|
|
|
|
public List<String> requiredArgs;
|
|
|
|
public LinkedHashMap<String, String> optionalArgs;
|
|
|
|
public boolean errorOnToManyArgs = true;
|
|
|
|
|
|
|
|
// FIELD: Help Short
|
|
|
|
// This field may be left blank and will in such case be loaded from the permissions node instead.
|
|
|
|
// Thus make sure the permissions node description is an action description like "eat hamburgers" or "do admin stuff".
|
|
|
|
private String helpShort;
|
|
|
|
|
|
|
|
public void setHelpShort(String val) {
|
|
|
|
this.helpShort = val;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getHelpShort() {
|
|
|
|
if (this.helpShort == null) {
|
2014-07-01 22:10:18 +02:00
|
|
|
String pdesc = p.perm.getPermissionDescription(this.permission);
|
|
|
|
if (pdesc != null) {
|
2014-04-04 20:55:21 +02:00
|
|
|
return pdesc;
|
2014-07-01 22:10:18 +02:00
|
|
|
}
|
|
|
|
return "*info unavailable*";
|
|
|
|
}
|
|
|
|
return this.helpShort;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public List<String> helpLong;
|
|
|
|
public CommandVisibility visibility;
|
|
|
|
|
|
|
|
// Some information on permissions
|
|
|
|
public boolean senderMustBePlayer;
|
|
|
|
public String permission;
|
|
|
|
|
|
|
|
// Information available on execution of the command
|
|
|
|
public CommandSender sender; // Will always be set
|
|
|
|
public Player me; // Will only be set when the sender is a player
|
|
|
|
public boolean senderIsConsole;
|
|
|
|
public List<String> args; // Will contain the arguments, or and empty list if there are none.
|
|
|
|
public List<MCommand<?>> commandChain = new ArrayList<MCommand<?>>(); // The command chain used to execute this command
|
|
|
|
|
|
|
|
public MCommand(T p) {
|
|
|
|
this.p = p;
|
|
|
|
|
|
|
|
this.permission = null;
|
|
|
|
|
|
|
|
this.allowNoSlashAccess = false;
|
|
|
|
|
2014-07-01 22:10:18 +02:00
|
|
|
this.subCommands = new ArrayList<MCommand<?>>();
|
|
|
|
this.aliases = new ArrayList<String>();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-07-01 22:10:18 +02:00
|
|
|
this.requiredArgs = new ArrayList<String>();
|
|
|
|
this.optionalArgs = new LinkedHashMap<String, String>();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-07-01 22:10:18 +02:00
|
|
|
this.helpShort = null;
|
|
|
|
this.helpLong = new ArrayList<String>();
|
|
|
|
this.visibility = CommandVisibility.VISIBLE;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// The commandChain is a list of the parent command chain used to get to this command.
|
|
|
|
public void execute(CommandSender sender, List<String> args, List<MCommand<?>> commandChain) {
|
|
|
|
// Set the execution-time specific variables
|
2014-07-01 22:10:18 +02:00
|
|
|
this.sender = sender;
|
|
|
|
if (sender instanceof Player) {
|
|
|
|
this.me = (Player) sender;
|
|
|
|
this.senderIsConsole = false;
|
2014-07-01 21:52:40 +02:00
|
|
|
} else {
|
2014-07-01 22:10:18 +02:00
|
|
|
this.me = null;
|
|
|
|
this.senderIsConsole = true;
|
|
|
|
}
|
|
|
|
this.args = args;
|
|
|
|
this.commandChain = commandChain;
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
// Is there a matching sub command?
|
|
|
|
if (args.size() > 0) {
|
|
|
|
for (MCommand<?> subCommand : this.subCommands) {
|
|
|
|
if (subCommand.aliases.contains(args.get(0))) {
|
2014-07-01 22:10:18 +02:00
|
|
|
args.remove(0);
|
|
|
|
commandChain.add(this);
|
|
|
|
subCommand.execute(sender, args, commandChain);
|
|
|
|
return;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-01 22:10:18 +02:00
|
|
|
if (!validCall(this.sender, this.args)) {
|
|
|
|
return;
|
|
|
|
}
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-07-01 22:10:18 +02:00
|
|
|
if (!this.isEnabled()) {
|
|
|
|
return;
|
|
|
|
}
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
perform();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void execute(CommandSender sender, List<String> args) {
|
|
|
|
execute(sender, args, new ArrayList<MCommand<?>>());
|
|
|
|
}
|
|
|
|
|
|
|
|
// This is where the command action is performed.
|
|
|
|
public abstract void perform();
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// Call Validation
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
/**
|
|
|
|
* In this method we validate that all prerequisites to perform this command has been met.
|
|
|
|
*/
|
|
|
|
// TODO: There should be a boolean for silence
|
|
|
|
public boolean validCall(CommandSender sender, List<String> args) {
|
2014-07-02 08:37:42 +02:00
|
|
|
return validSenderType(sender, true) && validSenderPermissions(sender, true) && validArgs(args, sender);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isEnabled() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean validSenderType(CommandSender sender, boolean informSenderIfNot) {
|
|
|
|
if (this.senderMustBePlayer && !(sender instanceof Player)) {
|
|
|
|
if (informSenderIfNot) {
|
|
|
|
msg(Lang.commandSenderMustBePlayer);
|
2014-07-01 22:10:18 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean validSenderPermissions(CommandSender sender, boolean informSenderIfNot) {
|
2014-07-02 08:37:42 +02:00
|
|
|
return this.permission == null || p.perm.has(sender, this.permission, informSenderIfNot);
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean validArgs(List<String> args, CommandSender sender) {
|
|
|
|
if (args.size() < this.requiredArgs.size()) {
|
|
|
|
if (sender != null) {
|
2014-07-01 22:10:18 +02:00
|
|
|
msg(Lang.commandToFewArgs);
|
|
|
|
sender.sendMessage(this.getUseageTemplate());
|
|
|
|
}
|
|
|
|
return false;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (args.size() > this.requiredArgs.size() + this.optionalArgs.size() && this.errorOnToManyArgs) {
|
|
|
|
if (sender != null) {
|
|
|
|
// Get the to many string slice
|
|
|
|
List<String> theToMany = args.subList(this.requiredArgs.size() + this.optionalArgs.size(), args.size());
|
|
|
|
msg(Lang.commandToManyArgs, TextUtil.implode(theToMany, " "));
|
|
|
|
sender.sendMessage(this.getUseageTemplate());
|
2014-07-01 22:10:18 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean validArgs(List<String> args) {
|
|
|
|
return this.validArgs(args, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// Help and Usage information
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public String getUseageTemplate(List<MCommand<?>> commandChain, boolean addShortHelp) {
|
2014-07-01 22:10:18 +02:00
|
|
|
StringBuilder ret = new StringBuilder();
|
|
|
|
ret.append(p.txt.parseTags("<c>"));
|
|
|
|
ret.append('/');
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
for (MCommand<?> mc : commandChain) {
|
2014-07-01 22:10:18 +02:00
|
|
|
ret.append(TextUtil.implode(mc.aliases, ","));
|
|
|
|
ret.append(' ');
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ret.append(TextUtil.implode(this.aliases, ","));
|
|
|
|
|
|
|
|
List<String> args = new ArrayList<String>();
|
|
|
|
|
|
|
|
for (String requiredArg : this.requiredArgs) {
|
|
|
|
args.add("<" + requiredArg + ">");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (Entry<String, String> optionalArg : this.optionalArgs.entrySet()) {
|
2014-07-01 22:10:18 +02:00
|
|
|
String val = optionalArg.getValue();
|
|
|
|
if (val == null) {
|
2014-04-04 20:55:21 +02:00
|
|
|
val = "";
|
2014-07-01 21:52:40 +02:00
|
|
|
} else {
|
2014-04-04 20:55:21 +02:00
|
|
|
val = "=" + val;
|
2014-07-01 22:10:18 +02:00
|
|
|
}
|
|
|
|
args.add("[" + optionalArg.getKey() + val + "]");
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (args.size() > 0) {
|
2014-07-01 22:10:18 +02:00
|
|
|
ret.append(p.txt.parseTags("<p> "));
|
|
|
|
ret.append(TextUtil.implode(args, " "));
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (addShortHelp) {
|
2014-07-01 22:10:18 +02:00
|
|
|
ret.append(p.txt.parseTags(" <i>"));
|
|
|
|
ret.append(this.getHelpShort());
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getUseageTemplate(boolean addShortHelp) {
|
|
|
|
return getUseageTemplate(this.commandChain, addShortHelp);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getUseageTemplate() {
|
|
|
|
return getUseageTemplate(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// Message Sending Helpers
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public void msg(String str, Object... args) {
|
|
|
|
sender.sendMessage(p.txt.parse(str, args));
|
|
|
|
}
|
2014-12-08 00:12:52 +01:00
|
|
|
|
|
|
|
public void msg(TL translation,Object... args){
|
|
|
|
sender.sendMessage(p.txt.parse(translation.toString(),args));
|
|
|
|
}
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
public void sendMessage(String msg) {
|
|
|
|
sender.sendMessage(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void sendMessage(List<String> msgs) {
|
|
|
|
for (String msg : msgs) {
|
|
|
|
this.sendMessage(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-13 19:45:57 +01:00
|
|
|
public void sendFancyMessage(FancyMessage message) {
|
|
|
|
message.send(sender);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void sendFancyMessage(List<FancyMessage> messages) {
|
2014-11-13 20:49:13 +01:00
|
|
|
for (FancyMessage m : messages) {
|
2014-11-13 19:45:57 +01:00
|
|
|
sendFancyMessage(m);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-13 20:49:13 +01:00
|
|
|
public List<String> getToolTips(FPlayer player) {
|
|
|
|
List<String> lines = new ArrayList<String>();
|
|
|
|
for (String s : p.getConfig().getStringList("tooltips.show")) {
|
|
|
|
lines.add(ChatColor.translateAlternateColorCodes('&', replaceFPlayerTags(s, player)));
|
|
|
|
}
|
|
|
|
return lines;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<String> getToolTips(Faction faction) {
|
|
|
|
List<String> lines = new ArrayList<String>();
|
|
|
|
for (String s : p.getConfig().getStringList("tooltips.list")) {
|
|
|
|
lines.add(ChatColor.translateAlternateColorCodes('&', replaceFactionTags(s, faction)));
|
|
|
|
}
|
|
|
|
return lines;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String replaceFPlayerTags(String s, FPlayer player) {
|
|
|
|
String humanized = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - player.getLastLoginTime(), true, true) + " ago";
|
|
|
|
String lastSeen = player.isOnline() ? ChatColor.GREEN + "Online" : (System.currentTimeMillis() - player.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized);
|
|
|
|
String balance = Econ.isSetup() ? Econ.getFriendlyBalance(player) : "no balance";
|
|
|
|
String power = player.getPowerRounded() + "/" + player.getPowerMaxRounded();
|
|
|
|
String group = P.p.getPrimaryGroup(Bukkit.getOfflinePlayer(player.getName()));
|
|
|
|
return s.replace("{balance}", balance).replace("{lastSeen}", lastSeen).replace("{power}", power).replace("{group}", group);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String replaceFactionTags(String s, Faction faction) {
|
|
|
|
boolean raidable = faction.getLandRounded() > faction.getPower();
|
|
|
|
FPlayer fLeader = faction.getFPlayerAdmin();
|
|
|
|
String online = String.valueOf(faction.getFPlayersWhereOnline(true).size());
|
|
|
|
String members = String.valueOf(faction.getFPlayers().size());
|
|
|
|
String leader = fLeader == null ? "Server" : fLeader.getName().substring(0, fLeader.getName().length() > 14 ? 13 : fLeader.getName().length());
|
|
|
|
return s.replace("{power}", String.valueOf(faction.getPowerRounded())).replace("{maxPower}", String.valueOf(faction.getPowerMaxRounded())).replace("{leader}", leader).replace("{chunks}", String.valueOf(faction.getLandRounded())).replace("{raidable}", String.valueOf(raidable)).replace("{warps}", String.valueOf(faction.getWarps().size())).replace("{online}", online).replace("{members}", members);
|
|
|
|
}
|
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// Argument Readers
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
// Is set? ======================
|
|
|
|
public boolean argIsSet(int idx) {
|
2014-07-02 08:37:42 +02:00
|
|
|
return this.args.size() >= idx + 1;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// STRING ======================
|
|
|
|
public String argAsString(int idx, String def) {
|
|
|
|
if (this.args.size() < idx + 1) {
|
|
|
|
return def;
|
2014-07-01 22:10:18 +02:00
|
|
|
}
|
|
|
|
return this.args.get(idx);
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public String argAsString(int idx) {
|
|
|
|
return this.argAsString(idx, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
// INT ======================
|
|
|
|
public Integer strAsInt(String str, Integer def) {
|
2014-07-01 22:10:18 +02:00
|
|
|
if (str == null) {
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
try {
|
2014-07-02 08:37:42 +02:00
|
|
|
return Integer.parseInt(str);
|
2014-04-04 20:55:21 +02:00
|
|
|
} catch (Exception e) {
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Integer argAsInt(int idx, Integer def) {
|
|
|
|
return strAsInt(this.argAsString(idx), def);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Integer argAsInt(int idx) {
|
|
|
|
return this.argAsInt(idx, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Double ======================
|
|
|
|
public Double strAsDouble(String str, Double def) {
|
2014-07-01 22:10:18 +02:00
|
|
|
if (str == null) {
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
try {
|
2014-07-02 08:37:42 +02:00
|
|
|
return Double.parseDouble(str);
|
2014-04-04 20:55:21 +02:00
|
|
|
} catch (Exception e) {
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Double argAsDouble(int idx, Double def) {
|
|
|
|
return strAsDouble(this.argAsString(idx), def);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Double argAsDouble(int idx) {
|
|
|
|
return this.argAsDouble(idx, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Go through the str conversion for the other arg-readers as well.
|
|
|
|
// Boolean ======================
|
|
|
|
public Boolean strAsBool(String str) {
|
|
|
|
str = str.toLowerCase();
|
2014-07-02 08:37:42 +02:00
|
|
|
return str.startsWith("y") || str.startsWith("t") || str.startsWith("on") || str.startsWith("+") || str.startsWith("1");
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public Boolean argAsBool(int idx, boolean def) {
|
2014-07-01 22:10:18 +02:00
|
|
|
String str = this.argAsString(idx);
|
|
|
|
if (str == null) {
|
|
|
|
return def;
|
|
|
|
}
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
return strAsBool(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Boolean argAsBool(int idx) {
|
|
|
|
return this.argAsBool(idx, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
// PLAYER ======================
|
|
|
|
public Player strAsPlayer(String name, Player def, boolean msg) {
|
|
|
|
Player ret = def;
|
|
|
|
|
|
|
|
if (name != null) {
|
2014-07-01 22:10:18 +02:00
|
|
|
Player player = Bukkit.getServer().getPlayer(name);
|
|
|
|
if (player != null) {
|
2014-04-04 20:55:21 +02:00
|
|
|
ret = player;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg && ret == null) {
|
|
|
|
this.msg("<b>No player \"<p>%s<b>\" could not be found.", name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player argAsPlayer(int idx, Player def, boolean msg) {
|
|
|
|
return this.strAsPlayer(this.argAsString(idx), def, msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player argAsPlayer(int idx, Player def) {
|
|
|
|
return this.argAsPlayer(idx, def, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player argAsPlayer(int idx) {
|
|
|
|
return this.argAsPlayer(idx, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEST PLAYER MATCH ======================
|
|
|
|
public Player strAsBestPlayerMatch(String name, Player def, boolean msg) {
|
|
|
|
Player ret = def;
|
|
|
|
|
|
|
|
if (name != null) {
|
2014-07-01 22:10:18 +02:00
|
|
|
List<Player> players = Bukkit.getServer().matchPlayer(name);
|
|
|
|
if (players.size() > 0) {
|
2014-04-04 20:55:21 +02:00
|
|
|
ret = players.get(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg && ret == null) {
|
|
|
|
this.msg("<b>No player match found for \"<p>%s<b>\".", name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player argAsBestPlayerMatch(int idx, Player def, boolean msg) {
|
|
|
|
return this.strAsBestPlayerMatch(this.argAsString(idx), def, msg);
|
|
|
|
}
|
2011-10-08 22:03:44 +02:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public Player argAsBestPlayerMatch(int idx, Player def) {
|
|
|
|
return this.argAsBestPlayerMatch(idx, def, true);
|
|
|
|
}
|
2011-10-08 22:03:44 +02:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public Player argAsBestPlayerMatch(int idx) {
|
|
|
|
return this.argAsPlayer(idx, null);
|
|
|
|
}
|
2011-10-08 22:03:44 +02:00
|
|
|
}
|