Last active
August 29, 2015 14:19
-
-
Save headswe/d658aa3714a0392cebf5 to your computer and use it in GitHub Desktop.
Demand : Map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Dictionary. Fast lookups are critical. | |
//Dictionaries provide fast lookups,based on keys,to get values. With them, we use keys and values of any type | |
// returns a new Dictionary handle | |
_map = createDictionary; | |
// dicthandle set [key,value]; | |
_map set ["mypos",getpos player]; | |
_map set [32,"threetwo"]; | |
_map set ["friend",_otherPlayer]; | |
// dicthandle get [key,defaultValue]; | |
// returns value | |
_value = _map get [32,-1]; | |
// dicthandle hasKey index | |
// returns boolean | |
_map hasKey 32; | |
// Keys dicthandle | |
// returns all keys in array | |
Keys _map | |
// Values dicthandle | |
// returns all Values in array | |
Values _map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment