1
Resolved Questions / Re: List inside list problem
« on: October 19, 2012, 12:22:21 pm »
First of all: yes, you're correct. When you add a list to another list, you're keeping "this particular list which might change over time", not "a list which contains items 1, 2, 3, 4 and it doesn't matter which list is that". Those list are kind of like Actors, but without Actors. I mean... uhh, forget about that analogy! ^^'
Second: if I were to compare the contents of two lists, I would do some loop checking equality of items at proper indices and probably pack it in a custom blocks. Though I suppose comparing the list to the text might be actually "neater", though probably some hardcore programmers would complain about it not being in proper coding style and such, especially with such unusual casting!
OR you can use the ArrayUtil function from Stencyl API. As far as I know, the code in API is rather safe update-to-3.0 wise though I might be wrong here. And you might pack it in global custom block so you wouldn't need to type it every damn type you would want to; after all, the whole idea behind DM is that you need to type things manually only as much as necessary!
The global custom block would have Boolean return value and "One List" and "Another List" list-type fields. Specification would probably make sense to be like "lists %0 and %1 are identical", and the only contents would be code block containing the following:
ArrayUtil.arraysAreEqual(__OneList, __AnotherList);
(note the double underscore!)
And why making it global? Because you won't need to attach some behavior to every scene where you could possibly use such check. Yay!
...hope this helps? ^^'
Second: if I were to compare the contents of two lists, I would do some loop checking equality of items at proper indices and probably pack it in a custom blocks. Though I suppose comparing the list to the text might be actually "neater", though probably some hardcore programmers would complain about it not being in proper coding style and such, especially with such unusual casting!
OR you can use the ArrayUtil function from Stencyl API. As far as I know, the code in API is rather safe update-to-3.0 wise though I might be wrong here. And you might pack it in global custom block so you wouldn't need to type it every damn type you would want to; after all, the whole idea behind DM is that you need to type things manually only as much as necessary!
The global custom block would have Boolean return value and "One List" and "Another List" list-type fields. Specification would probably make sense to be like "lists %0 and %1 are identical", and the only contents would be code block containing the following:
ArrayUtil.arraysAreEqual(__OneList, __AnotherList);
(note the double underscore!)
And why making it global? Because you won't need to attach some behavior to every scene where you could possibly use such check. Yay!
...hope this helps? ^^'