From 496c337cdfa593654018c171f6a74c28272265b5 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Fri, 1 Sep 2017 12:04:50 +0100 Subject: Replace ItemCallbacks with lambdas (#3948) --- src/Scoreboard.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Scoreboard.h') 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 class cObjective; class cTeam; class cWorld; -typedef cItemCallback cObjectiveCallback; -typedef cItemCallback cTeamCallback; +using cObjectiveCallback = std::function; +using cTeamCallback = std::function; @@ -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); -- cgit v1.2.3