1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. The results are out! Check them out.
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Coding efficient vJASS structs

Discussion in '"Graveyard"' started by Nestharus, Jan 17, 2011.

  1. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    gy this please
     
    Last edited: Feb 4, 2014
  2. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Nice tutorial, simple enough. I like that you included the generated code, as it definitely makes the difference clear.

    I'll need to reorganize it a bit before I can approve it, but this is definitely a useful tutorial, and overall the custom allocators/deallocators don't look that bad either.

    EDIT: Whatever, it is organized well enough. ~Approved.
     
    Last edited: Jan 20, 2011
  3. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,033
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    The doublefree protection should not be there when having debugmode disabled.

    You could also directly have used allocate/deallocate instead of create/destroy.
     
  4. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    ->You could also directly have used allocate/deallocate instead of create/destroy.

    vJASS convention is to name constructors and destructors create/destroy, not allocate/deallocate.

    ->The doublefree protection should not be there when having debugmode disabled.
    You sure? : o

    Anywho, it still spams triggers with extending >: P
     
  5. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,034
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    This is probably my favorite tutorial from the ones you released because almost no one knows what vJass is really doing.
     
  6. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
  7. Tom_Kazansky

    Tom_Kazansky

    Joined:
    Dec 17, 2008
    Messages:
    18
    Resources:
    0
    Resources:
    0
    wow, I have never known about this, thanks for posting this.

    also, I have a question: is the case "struct extends interface" like "struct extends struct"?
     
  8. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    gy this please