Documentation

This commit is contained in:
FlightControl 2018-09-28 22:16:09 +02:00
parent 5becf001ba
commit 3a8530227d

View File

@ -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