Search the Community
Showing results for tags 'digital tree'.
Found 1 result
-
Object Oriented DIGITAL TREE Lastest version: 0.4 by Code34 Like to Donate ? Donate with paypal Github: https://github.com/code34/oo_digitaltree.Altis Reference: http://forums.bistudio.com/showthread.php?167980-Object-Oriented-SQF-Scripting-and-Compiling Wikipedia: http://en.wikipedia.org/wiki/Trie Description OO DIGITAL TREE is a class (object oriented) digital tree that permits to stock value like string, scalar, object, etc... in a digital tree. This object will permits to stock objects in digital tree, and give linear time access to them. Time access to record depends of the key size. Features: Put, remove, search value Retrieve keyset, and entryset Licence: Under Gpl, you can share, modify, distribute this script but don't remove the licence and the name of the original author Warning: The script uses sleep for scheduled environment. Documentation: /* Author: code34 nicolas_boiteux@yahoo.fr Copyright (C) 2013 Nicolas BOITEUX CLASS OO_TREE OO_NODE This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Function: = ["get", key] call OO_TREE; Retrieve the value associated to a key Parameters: key - string */ /* Function: = ["put", [key, value]] call OO_TREE; Put/update a value associated to a key Parameters: key - string value - any kind of value */ /* Function: = ["remove", key] call OO_TREE; Remove the value associated to key Parameters: key - string */ /* Function: = "entrySet" call OO_TREE; Return all the value in the digital tree Parameters: none */ /* Function: = "keySet" call OO_TREE; Return all the keys in the digital tree Parameters: none */ /* Function: = "size" call OO_TREE; Return the number of values in the digital tree Parameters: none */ Readme: /* Author: code34 nicolas_boiteux@yahoo.fr Copyright (C) 2013 Nicolas BOITEUX CLASS OO_DIGITAL TREE This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ Usage: put the "oo_tree.sqf", "oo_node.sqf", and the "oop.h" files in your mission directory put this code into your mission init.sqf call compilefinal preprocessFileLineNumbers "oo_tree.sqf"; call compilefinal preprocessFileLineNumbers "oo_node.sqf"; See example mission in directory: init.sqf Licence: You can share, modify, distribute this script but don't remove the licence and the name of the original author logs: 0.3 - fix parseChildKeySet 0.2 - Make Arma Not War version 0.1 - OO DIGITAL TREE - first release Examples Put string value into the digital tree. _tree = ["new", []] call OO_TREE; _key = name player; _value = "my entry value"; ["put", [_key, _value]] call _tree; Retrieve the value into the digital tree _key = name player; _value = ["get", _key] call _tree; hint format ["%1", _value]; Put an object into digital tree _tree = ["new", []] call OO_TREE; _key = name player; _value = player; ["put", [_key, _value]] call _tree; Retrieve the object into digital tree _key = name player; _value = ["get", _key] call _tree; hint format ["%1", _value];