use of pl.themolka.arcade.match.MatchGame in project Arcade2 by ShootGame.
the class KillEnemiesGame method onEnable.
@Override
public void onEnable() {
MatchGame module = (MatchGame) this.getGame().getModule(MatchModule.class);
this.match = module.getMatch();
this.match.registerDynamicWinnable(this);
for (Map.Entry<Participator, KillEnemies> entry : this.byOwner.entrySet()) {
MatchWinner winner = this.match.findWinnerById(entry.getKey().getId());
if (winner == null) {
continue;
}
winner.addGoal(entry.getValue());
}
}
use of pl.themolka.arcade.match.MatchGame in project Arcade2 by ShootGame.
the class TeamsGame method onEnable.
@Override
public void onEnable() {
this.commands = new TeamCommands(this);
MatchGame module = (MatchGame) this.getGame().getModule(MatchModule.class);
this.match = module.getMatch();
for (Team team : this.teamsById.values()) {
team.setMatch(this.match);
this.match.registerWinner(team);
}
this.teamsById.put(this.match.getObservers().getId(), this.match.getObservers());
this.window = new TeamWindow(this);
this.window.create();
// register
this.getGame().getWindowRegistry().addWindow(this.getWindow());
this.match.setPlayWindow(this.getWindow());
this.match.setObserverHandler(this);
// cache
Observers observers = this.match.getObservers();
for (GamePlayer observer : observers.getOnlineMembers()) {
this.teamsByPlayer.put(observer, observers);
}
}
use of pl.themolka.arcade.match.MatchGame in project Arcade2 by ShootGame.
the class ScoreGame method onEnable.
@Override
public void onEnable() {
MatchGame module = (MatchGame) this.getGame().getModule(MatchModule.class);
this.match = module.getMatch();
this.match.registerDynamicWinnable(this);
for (Map.Entry<Participator, Score> entry : this.byOwner.entrySet()) {
MatchWinner winner = this.match.findWinnerById(entry.getKey().getId());
if (winner == null) {
continue;
}
Score score = entry.getValue();
score.setMatch(this.match);
winner.addGoal(score);
}
}
Aggregations