more common code cleanup

This commit is contained in:
commy2 2015-09-19 21:33:25 +02:00
parent 450ee98004
commit bfd5d13de8
10 changed files with 143 additions and 22 deletions

View File

@ -1,5 +1,15 @@
//fnc_hashCreate.sqf
/*
* Author: ?
* Returns an empty hash structure
*
* Arguments:
* None
*
* Return Value:
* Empty Hash Structure <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
// diag_log text format["%1 HASH CREATE"];
[[],[]]

View File

@ -1,10 +1,21 @@
//fnc_hashGet.sqf
/*
* Author: ?
* Returns value attached to key in given hash.
*
* Arguments:
* 0: Hash <ARRAY>
* 1: Key <STRING>
*
* Return Value:
* Value <ANY>
*
* Public: No
*/
#include "script_component.hpp"
private ["_val", "_index"];
// diag_log text format["%1 HASH GET: %2", ACE_diagTime, _this];
PARAMS_2(_hash,_key);
params ["_hash", "_key"];
ERRORDATA(2);
_val = nil;
@ -25,4 +36,5 @@ try {
};
if (isNil "_val") exitWith { nil };
_val;
_val

View File

@ -1,10 +1,22 @@
//fnc_hashHasKey.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
private ["_val", "_index"];
// diag_log text format["%1 HASH HAS KEY: %2", ACE_diagTime, _this];
PARAMS_2(_hash,_key);
params ["_hash", "_key"];
ERRORDATA(2);
_val = false;

View File

@ -1,9 +1,21 @@
//fnc_hashListCreateHash.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
private ["_hashKeys"];
PARAMS_1(_hashList);
params ["_hashList"];
ERRORDATA(1);
_hashKeys = [];

View File

@ -1,6 +1,18 @@
//fnc_hashListCreateList.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
PARAMS_1(_keys);
params ["_keys"];
[_keys,[]];

View File

@ -1,7 +1,19 @@
//fnc_hashListPush.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
PARAMS_2(_hashList,_value);
params ["_hashList", "_value"];
ERRORDATA(2);
try {

View File

@ -1,9 +1,22 @@
//fnc_hashListSelect.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
private ["_hash", "_keys", "_hashes", "_values"];
PARAMS_2(_hashList,_index);
params ["_hashList", "_index"];
ERRORDATA(2);
_hash = nil;
try {

View File

@ -1,9 +1,22 @@
//fnc_hashListSet.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
private ["_vals"];
PARAMS_3(_hashList,_index,_value);
params ["_hashList", "_index", "_value"];
ERRORDATA(3);
try {
if(VALIDHASH(_hashList)) then {

View File

@ -1,9 +1,22 @@
//fnc_hashRem.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
private ["_val", "_index"];
PARAMS_2(_hash,_key);
params ["_hash", "_key"];
ERRORDATA(2);
_val = nil;
try {

View File

@ -1,10 +1,22 @@
//fnc_hashSet.sqf
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
private ["_index"];
// diag_log text format["%1 HASH SET: %2", ACE_diagTime, _this];
PARAMS_3(_hash,_key,_val);
params ["_hash", "_key", "_val"];
ERRORDATA(3);
try {