mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Task Scores are now calculating correctly
The task scores are now working . Jippie!!!! Demo time!!!
This commit is contained in:
@@ -896,23 +896,7 @@ end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Adds a score for the FSM_PROCESS to be achieved.
|
||||
-- @param #FSM_PROCESS self
|
||||
-- @param #string State is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
|
||||
-- @param #string ScoreText is a text describing the score that is given according the status.
|
||||
-- @param #number Score is a number providing the score of the status.
|
||||
-- @return #FSM_PROCESS self
|
||||
function FSM_PROCESS:AddScore( State, ScoreText, Score )
|
||||
self:F2( { State, ScoreText, Score } )
|
||||
|
||||
self.Scores[State] = self.Scores[State] or {}
|
||||
self.Scores[State].ScoreText = ScoreText
|
||||
self.Scores[State].Score = Score
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
function FSM_PROCESS:onenterAssigned( ProcessUnit )
|
||||
self:T( "Assign" )
|
||||
|
||||
@@ -944,14 +928,14 @@ end
|
||||
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
||||
end
|
||||
|
||||
self:T( self.Scores[To] )
|
||||
self:T( self._Scores[To] )
|
||||
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
|
||||
if self.Scores[To] then
|
||||
if self._Scores[To] then
|
||||
|
||||
local Task = self.Task
|
||||
local Scoring = Task:GetScoring()
|
||||
if Scoring then
|
||||
Scoring:_AddMissionTaskScore( Task.Mission, ProcessUnit, self.Scores[To].ScoreText, self.Scores[To].Score )
|
||||
Scoring:_AddMissionTaskScore( Task.Mission, ProcessUnit, self._Scores[To].ScoreText, self._Scores[To].Score )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user