From 3a8530227d61600d8682df4949277a4feb1e5882 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 28 Sep 2018 22:16:09 +0200 Subject: [PATCH] Documentation --- Moose Development/Moose/Core/Goal.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Core/Goal.lua b/Moose Development/Moose/Core/Goal.lua index 926e8eca1..f530deb33 100644 --- a/Moose Development/Moose/Core/Goal.lua +++ b/Moose Development/Moose/Core/Goal.lua @@ -107,8 +107,9 @@ do -- Goal end - --- @param #GOAL self - -- @param #string PlayerName + --- Add a new contribution by a player. + -- @param #GOAL self + -- @param #string PlayerName The name of the player. function GOAL:AddPlayerContribution( PlayerName ) self.Players[PlayerName] = self.Players[PlayerName] or 0 self.Players[PlayerName] = self.Players[PlayerName] + 1 @@ -123,21 +124,28 @@ do -- Goal end - --- @param #GOAL self + --- Get the players who contributed to achieve the goal. + -- The result is a list of players, sorted by the name of the players. + -- @param #GOAL self + -- @return #list The list of players, indexed by the player name. function GOAL:GetPlayerContributions() return self.Players or {} end - --- @param #GOAL self + --- Gets the total contributions that happened to achieve the goal. + -- The result is a number. + -- @param #GOAL self + -- @return #number The total number of contributions. 0 is returned if there were no contributions (yet). function GOAL:GetTotalContributions() return self.TotalContributions or 0 end - --- @param #GOAL self - -- @return #boolean true if the goal is Achieved + --- Validates if the goal is achieved. + -- @param #GOAL self + -- @return #boolean true if the goal is achieved. function GOAL:IsAchieved() return self:Is( "Achieved" ) end