2014-08-18 22:41:16 +02:00
|
|
|
package nautilus.game.arcade.stats;
|
|
|
|
|
2014-08-26 22:30:55 +02:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Listener;
|
|
|
|
|
|
|
|
import nautilus.game.arcade.game.Game;
|
2014-08-18 22:41:16 +02:00
|
|
|
|
|
|
|
public class StatTracker<G extends Game> implements Listener
|
|
|
|
{
|
|
|
|
private final G game;
|
|
|
|
|
|
|
|
public StatTracker(G game)
|
|
|
|
{
|
|
|
|
this.game = game;
|
|
|
|
}
|
|
|
|
|
|
|
|
public G getGame()
|
|
|
|
{
|
|
|
|
return game;
|
|
|
|
}
|
2014-08-26 22:30:55 +02:00
|
|
|
|
|
|
|
public boolean canAddStats()
|
|
|
|
{
|
2014-08-27 00:57:11 +02:00
|
|
|
return getGame().CanAddStats;
|
2014-08-26 22:30:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void addStat(Player player, String stat, int value, boolean limitTo1, boolean global)
|
|
|
|
{
|
|
|
|
if (canAddStats())
|
|
|
|
addStat(player, stat, value, limitTo1, global);
|
|
|
|
}
|
2014-08-18 22:41:16 +02:00
|
|
|
}
|