mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-24 12:05:27 +00:00
Documentation
This commit is contained in:
@@ -107,8 +107,9 @@ do -- Goal
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #GOAL self
|
--- Add a new contribution by a player.
|
||||||
-- @param #string PlayerName
|
-- @param #GOAL self
|
||||||
|
-- @param #string PlayerName The name of the player.
|
||||||
function GOAL:AddPlayerContribution( PlayerName )
|
function GOAL:AddPlayerContribution( PlayerName )
|
||||||
self.Players[PlayerName] = self.Players[PlayerName] or 0
|
self.Players[PlayerName] = self.Players[PlayerName] or 0
|
||||||
self.Players[PlayerName] = self.Players[PlayerName] + 1
|
self.Players[PlayerName] = self.Players[PlayerName] + 1
|
||||||
@@ -123,21 +124,28 @@ do -- Goal
|
|||||||
end
|
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()
|
function GOAL:GetPlayerContributions()
|
||||||
return self.Players or {}
|
return self.Players or {}
|
||||||
end
|
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()
|
function GOAL:GetTotalContributions()
|
||||||
return self.TotalContributions or 0
|
return self.TotalContributions or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @param #GOAL self
|
--- Validates if the goal is achieved.
|
||||||
-- @return #boolean true if the goal is Achieved
|
-- @param #GOAL self
|
||||||
|
-- @return #boolean true if the goal is achieved.
|
||||||
function GOAL:IsAchieved()
|
function GOAL:IsAchieved()
|
||||||
return self:Is( "Achieved" )
|
return self:Is( "Achieved" )
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user