diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-01 21:12:44 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-01 21:12:44 +0200 |
commit | 6e3e7552e67dfc0254c3e99bcd32fea02f10d062 (patch) | |
tree | 84bfd40d2c2693cab44a47d4902aa601d8a715e6 /src/Scoreboard.h | |
parent | d (diff) | |
parent | SetSwimState now takes into account head height (diff) | |
download | cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.gz cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.bz2 cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.lz cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.xz cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.zst cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.zip |
Diffstat (limited to 'src/Scoreboard.h')
-rw-r--r-- | src/Scoreboard.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Scoreboard.h b/src/Scoreboard.h index 597c502c7..047a0cf7b 100644 --- a/src/Scoreboard.h +++ b/src/Scoreboard.h @@ -1,4 +1,4 @@ - + // Scoreboard.h // Implementation of a scoreboard that keeps track of specified objectives @@ -11,14 +11,15 @@ +#include <functional> class cObjective; class cTeam; class cWorld; -typedef cItemCallback<cObjective> cObjectiveCallback; -typedef cItemCallback<cTeam> cTeamCallback; +using cObjectiveCallback = std::function<bool(cObjective &)>; +using cTeamCallback = std::function<bool(cTeam &)>; @@ -266,15 +267,15 @@ public: /** Execute callback for each objective with the specified type Returns true if all objectives processed, false if the callback aborted by returning true. */ - bool ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallback & a_Callback); + bool ForEachObjectiveWith(cObjective::eType a_Type, const cObjectiveCallback & a_Callback); /** Execute callback for each objective. Returns true if all objectives have been processed, false if the callback aborted by returning true. */ - bool ForEachObjective(cObjectiveCallback & a_Callback); // Exported in ManualBindings.cpp + bool ForEachObjective(const cObjectiveCallback & a_Callback); // Exported in ManualBindings.cpp /** Execute callback for each team. Returns true if all teams have been processed, false if the callback aborted by returning true. */ - bool ForEachTeam(cTeamCallback & a_Callback); // Exported in ManualBindings.cpp + bool ForEachTeam(const cTeamCallback & a_Callback); // Exported in ManualBindings.cpp void SetDisplay(cObjective * a_Objective, eDisplaySlot a_Slot); |