-
Notifications
You must be signed in to change notification settings - Fork 519
Lazy Lists
Werner edited this page Jul 26, 2019
·
5 revisions
The LAZY* helpers are a set of defines useful for working with lists in a way that only keeps them around when they're actually needed. Lazy list operators should not be used on lists that are passed by reference as they may break the reference.
Lazy lists are useful for lowering the memory usage of list heavy objects and should generally be preferred over standard lists.
Macro | Function |
---|---|
LAZYADD(list,item) |
Adds item to list . if list is null, it is created. |
LAZYREMOVE(list,item) |
Removes item from list . If list is null, nothing is done. If list has 0 length after the item is removed, it is nulled out. |
LAZYACCESS(list,index) |
Accesses index index of list . if list is null, null is returned. If index is a number and index is greater than list.len , null is returned. Otherwise, value at list[index] is returned. |
LAZYLEN(list) |
Gets the length of list . If list is null, returns 0 . |
LAZYCLEARLIST(list) |
Clears list via. Cut() . If list is null, nothing is done. |
UNSETEMPTY(list) |
If list has no length, it is nulled out. Otherwise, nothing is done. |
LAZYINITLIST(list) |
If list is null, a new list is created and assigned to list . |
LAZYSET(list,item,value) |
Sets a item in the list to the value. If list is null, a new list is created, the item with the specified value added and assigned to list . |
LAZYPICK(list,default) |
Picks a item from list. If the list is empty returns the default. |
A collection of standards and guidelines applied to the codebase.
Documentation regarding common APIs which speed up feature implementation and should be known by all coders.
- Atom Initialization
- Garbage, Queued Deletion, and Destroy
- Callbacks
- Timers
- Lazy Lists
- Overlays
- Processing APIs
- Common Helpers
- Global Listeners
- Singletons
Documentation for less used APIs that are not often needed.
Documentation regarding our implementation of StonedMC (SMC).
Decrepit or unused systems.
- Dynamic Maps (Not to be confused with the newer away mission implementation.)