Computer Science Canada Multidimensional flexible arrays using classes |
Author: | NikG [ Sun Sep 10, 2006 1:50 am ] | ||||
Post subject: | Multidimensional flexible arrays using classes | ||||
I've been trying to figure out a solution to Turing's inability to resize multidimensional flexible arrays for my rts game. One of the posts on this site suggested using classes, so I decided to try it:
This works, and resizing it simply involves the following:
The only problem with this is that I'm not sure about how well it can remember the old values when you resize it. Hope this helps those of you trying to solve this problem. |
Author: | Clayton [ Sun Sep 10, 2006 8:53 am ] | ||
Post subject: | |||
Interesting... its a fairly round about way of doing it but it gets the job done (even if it is tedious ![]()
for a pointer to reference an object, all turing is doing here is assuming what object you want, and while you only have one here, its not so bad, but its just a general bad coding practice. |
Author: | NikG [ Sun Sep 10, 2006 12:48 pm ] | ||
Post subject: | |||
Right you are Freakman. Guess I was just being lazy... For those of you who don't know, the correct way should be:
|