Difference between revisions of "Dynamic Storage"
Jump to navigation
Jump to search
no edit summary
imported>Tegid |
imported>Tegid |
||
Line 111: | Line 111: | ||
===Linked List=== | ===Linked List=== | ||
A Linked List allows easy sorting and consistent and one at a time access. It is often easier to program around a linked-list because you know that you will always get one item back at a time, and the way Oblivion runs scripts, often times traversing an entire list still just takes one frame. Not only that, but we can make a list that acts like an array with easy index access. (Behind the scenes though, it is what we refer to as a List Traversal to get to the index you request) It is also very easy to remove items from lists. This is not so easy with an Array. | A Linked List allows easy sorting and consistent and one at a time access. It is often easier to program around a linked-list because you know that you will always get one item back at a time, and the way Oblivion runs scripts, often times traversing an entire list still just takes one frame. Not only that, but we can make a list that acts like an array with easy index access. (Behind the scenes though, it is what we refer to as a List Traversal to get to the index you request) It is also very easy to remove items from lists. This is not so easy with an Array. | ||
[ | [[Linked List Tutorial]] | ||
===Array=== | ===Array=== | ||
Arrays give you handy indexing so it is easy to get the item you want. In fact we can make a list that acts like an array in terms of indexing. But once you've got data into the list, you can change it, but erasing it is a very time consuming process (because we have to keep the indexes correct, that means everything after the affected index has to be adjusted to deal with the removed index). We can also set your array up so that it takes the exact same number of frames to get the first element as the 1000th element. There are some nice tricks we can play with arrays, but in general they are harder to understand because they rely on the idea of doing a lot of things to a lot of nodes at the same time. | Arrays give you handy indexing so it is easy to get the item you want. In fact we can make a list that acts like an array in terms of indexing. But once you've got data into the list, you can change it, but erasing it is a very time consuming process (because we have to keep the indexes correct, that means everything after the affected index has to be adjusted to deal with the removed index). We can also set your array up so that it takes the exact same number of frames to get the first element as the 1000th element. There are some nice tricks we can play with arrays, but in general they are harder to understand because they rely on the idea of doing a lot of things to a lot of nodes at the same time. | ||
[[ | [[Array Tutorial]] | ||
[[Category: Tutorials]] |