Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CBA_fnc_createNamespace and CBA_fnc_deleteNamespace #260

Merged
merged 2 commits into from
Feb 13, 2016

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Feb 11, 2016

This is a faster alternative to creating pseudo-namespaces compared to createVehicleLocal with Logic or similar. It also never runs into any limitations regarding group count and is strictly local.
It is based on creating a location outside of the map which is used as container for variables.

Perf test:
call CBA_fnc_createNamespace;
0.0207031 ms
(10000/10000)

"Logic" createVehicleLocal [-1000,-1000,0];
0.138744 ms
(6649/10000)

Usage:

test_namespace = call CBA_fnc_createNamespace;
test_namespace setVariable ["test_value", 123];
test_namespace getVariable "test_value"
-> 123
allVariables test_namespace
["test_value"]
test_namespace call CBA_fnc_deleteNamespace;

Only downside is, that the getVariable ARRAY syntax does not work it.

commy2
---------------------------------------------------------------------------- */
#include "script_component.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCRIPT(createNamespace);

Killswitch00 added a commit that referenced this pull request Feb 13, 2016
add CBA_fnc_createNamespace and CBA_fnc_deleteNamespace
@Killswitch00 Killswitch00 merged commit f5ac24b into master Feb 13, 2016
@nicolasbadano
Copy link
Contributor

Perfect for ACE. Thanks

@thojkooi thojkooi deleted the createNamespace branch April 25, 2016 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants