| 03-02-2009, 12:32 PM | #1 |
Unless I'm just making things up in my head, I have seen script like: JASS:struct A extends array endstruct //somewhere set A[0] = A.create() call A.whatever() //etc. This is what I have: JASS:library Camera initializer Init requires Effect globals private constant integer MAX_QUEUED_CAMERAS = 10 endglobals private struct PlayerCamera extends array private CameraTemplate array cam[MAX_QUEUED_CAMERAS] private integer intCountCamera = 0 endstruct struct CameraTemplate extends Effect endstruct private function Init takes nothing returns nothing endfunction endlibrary but that won't compile. What's wrong? Also, if I can create an array of the struct, how do I limit it to 12 instances? |
| 03-02-2009, 12:49 PM | #2 |
The snippet you saw somewhere is wrong.. array structs cant be allocated/created you cant have array variables in a struct which extends array ... and i dont think you can limit the instance count a struct which extends an array.. JASS:private struct PlayerCamera[12] private CameraTemplate array cam[MAX_QUEUED_CAMERAS] private integer intCountCamera = 0 endstruct |
| 03-02-2009, 12:58 PM | #3 |
That is what I have in mind as an alternative. Just wanted to check if the above is possible; guess I just made it up in my head. |
