Revision of core classes documentation.

This commit is contained in:
FlightControl
2018-10-09 19:30:57 +02:00
parent e6f51af34c
commit f03a2e3657
20 changed files with 298 additions and 86 deletions

View File

@@ -1,8 +1,16 @@
--- **Core (WIP)** -- Base class to allow the modeling of processes to achieve Goals.
--- **Core** - Models the process to achieve goal(s).
--
-- ===
--
-- GOAL models processes that have an objective with a defined achievement. Derived classes implement the ways how the achievements can be realized.
-- ## Features:
--
-- * Define the goal.
-- * Monitor the goal achievement.
-- * Manage goal contribution by players.
--
-- ===
--
-- Classes that implement a goal achievement, will derive from GOAL to implement the ways how the achievements can be realized.
--
-- ===
--
@@ -13,6 +21,7 @@
-- @module Core.Goal
-- @image Core_Goal.JPG
do -- Goal
--- @type GOAL
@@ -21,21 +30,43 @@ do -- Goal
--- Models processes that have an objective with a defined achievement. Derived classes implement the ways how the achievements can be realized.
--
-- ## 1. GOAL constructor
-- # 1. GOAL constructor
--
-- * @{#GOAL.New}(): Creates a new GOAL object.
--
-- ## 2. GOAL is a finite state machine (FSM).
-- # 2. GOAL is a finite state machine (FSM).
--
-- ### 2.1 GOAL States
-- ## 2.1. GOAL States
--
-- * **Pending**: The goal object is in progress.
-- * **Achieved**: The goal objective is Achieved.
--
-- ### 2.2 GOAL Events
-- ## 2.2. GOAL Events
--
-- * **Achieved**: Set the goal objective to Achieved.
--
-- # 3. Player contributions.
--
-- Goals are most of the time achieved by players. These player achievements can be registered as part of the goal achievement.
-- Use @{#GOAL.AddPlayerContribution}() to add a player contribution to the goal.
-- The player contributions are based on a points system, an internal counter per player.
-- So once the goal has been achieved, the player contributions can be queried using @{#GOAL.GetPlayerContributions}(),
-- that retrieves all contributions done by the players. For one player, the contribution can be queried using @{#GOAL.GetPlayerContribution}().
-- The total amount of player contributions can be queried using @{#GOAL.GetTotalContributions}().
--
-- # 4. Goal achievement.
--
-- Once the goal is achieved, the mission designer will need to trigger the goal achievement using the **Achieved** event.
-- The underlying 2 examples will achieve the goals for the `Goal` object:
--
-- Goal:Achieved() -- Achieve the goal immediately.
-- Goal:__Achieved( 30 ) -- Achieve the goal within 30 seconds.
--
-- # 5. Check goal achievement.
--
-- The method @{#GOAL.IsAchieved}() will return true if the goal is achieved (the trigger **Achieved** was executed).
-- You can use this method to check asynchronously if a goal has been achieved, for example using a scheduler.
--
-- @field #GOAL
GOAL = {
ClassName = "GOAL",