-
Notifications
You must be signed in to change notification settings - Fork 0
Function Documentation
Daisy edited this page Mar 26, 2024
·
1 revision
This mod documents its functions in a similar way to CBA, using NatualDocs. If contributing to this framework, please follow the template for function documentation to allow for easy, automated documentation.
/*
Function: TAG_fnc_function
Description:
Desc
Parameters:
_param1 - param desc [type]
Returns:
value
Examples:
--- Code
example code 1
---
--- Code
example code 2
---
Author: person
*/
/*
Function: RPF_fnc_alterPool
Description:
Alters _varName pool on object _obj by _amount with _methods
Parameters:
_obj - The object you want to alter all the pools of [Object]
_varName - The name of the pool you want to alter [String]
_amount - The amount which you want to alter each pool by [Number]
_methods - The methods of alteration [Array of methods] in format [_mathOperation,_overflowMethod]
> Index 0: True or "s" if subtraction, false or "a" if addition (default false) [Boolean or String]
> Index 1: True or "r" if reject an alteration over the limit, false or "c" if clamp the alteration to the limit (default false) [Boolean or String]
Returns:
true on failure, final altered amount on success
Examples:
--- Code
// subtracts 20 from "pool" on box1 and clamps if it exceeds the limits.
// returns (current value of pool - 20) if not clamped, returns lower bound (always 0) if clamped
[box1,"pool",20,[true,false]] call RPF_fnc_alterPool;
---
--- Code
// adds 45 to "pool" on bag12 and rejects it if it exceeds the limits.
// returns (current value of pool + 45) if not rejected, false if rejected
[bag12,"pool",45,["a","r"]] call RPF_fnc_alterPool;
---
Author: Daisy
*/