aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Score.h
blob: 2a32f138c9fb5c69e5610467962fbe5e72d4ea8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once

class Scoreboard;
class Objective;

class Score
{
public:
	// 4J Not converted
#if 0
	static final Comparator<Score> SCORE_COMPARATOR = new Comparator<Score>() {
		@Override
			public int compare(Score o1, Score o2) {
				if (o1.getScore() > o2.getScore()) {
					return 1;
				} else if (o1.getScore() < o2.getScore()) {
					return -1;
				} else {
					return 0;
				}
		}
	};
#endif

private:
	Scoreboard *scoreboard;
	Objective *objective;
	wstring owner;
	int count;

public:
	Score(Scoreboard *scoreboard, Objective *objective, const wstring &owner);

	void add(int count);
	void remove(int count);
	void increment();
	void decrement();
	int getScore();
	void setScore(int score);
	Objective *getObjective();
	wstring getOwner();
	Scoreboard *getScoreboard();
	void updateFor(vector<shared_ptr<Player> > *players);
};