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

Projects
None yet
3 participants
@commy2
Contributor

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 commy2 added the Enhancement label Feb 11, 2016

@commy2 commy2 self-assigned this Feb 11, 2016

Show outdated Hide outdated addons/common/fnc_createNamespace.sqf
commy2
---------------------------------------------------------------------------- */
#include "script_component.hpp"

This comment has been minimized.

@Killswitch00

Killswitch00 Feb 13, 2016

Contributor

SCRIPT(createNamespace);

@Killswitch00

Killswitch00 Feb 13, 2016

Contributor

SCRIPT(createNamespace);

Show outdated Hide outdated addons/common/fnc_deleteNamespace.sqf
commy2
---------------------------------------------------------------------------- */
#include "script_component.hpp"

This comment has been minimized.

@Killswitch00

Killswitch00 Feb 13, 2016

Contributor

SCRIPT(deleteNamespace);

@Killswitch00

Killswitch00 Feb 13, 2016

Contributor

SCRIPT(deleteNamespace);

Killswitch00 added a commit that referenced this pull request Feb 13, 2016

Merge pull request #260 from CBATeam/createNamespace
add CBA_fnc_createNamespace and CBA_fnc_deleteNamespace

@Killswitch00 Killswitch00 merged commit f5ac24b into master Feb 13, 2016

@esteldunedain

This comment has been minimized.

Show comment
Hide comment
@esteldunedain

esteldunedain Feb 13, 2016

Contributor

Perfect for ACE. Thanks

Contributor

esteldunedain commented Feb 13, 2016

Perfect for ACE. Thanks

@thojkooi thojkooi deleted the createNamespace branch Apr 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment