Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java

56 lines
1.1 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel.games;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.wired.WiredHandler;
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
public class GamePlayer
{
2018-07-08 23:32:00 +02:00
2019-03-18 02:22:00 +01:00
private final Habbo habbo;
2018-07-06 15:30:00 +02:00
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
private GameTeamColors teamColor;
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
private int score;
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
public GamePlayer(Habbo habbo, GameTeamColors teamColor)
{
this.habbo = habbo;
this.teamColor = teamColor;
}
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
public void reset()
{
this.score = 0;
}
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
public synchronized void addScore(int amount)
{
this.score += amount;
WiredHandler.handle(WiredTriggerType.SCORE_ACHIEVED, null, this.habbo.getHabboInfo().getCurrentRoom(), new Object[]{this.habbo.getHabboInfo().getCurrentRoom().getGame(this.habbo.getHabboInfo().getCurrentGame()).getTeamForHabbo(this.habbo).getTotalScore(), amount});
}
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
public Habbo getHabbo()
{
return this.habbo;
}
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
public GameTeamColors getTeamColor()
{
return this.teamColor;
}
2018-07-08 23:32:00 +02:00
2018-07-06 15:30:00 +02:00
public int getScore()
{
return this.score;
}
}