Starting JASS

tooltiperror

Super Moderator
Reaction score
231
^adding on what king said.

JASS:

struct Data
 method empathy takes nothing returns nothing
 endmethod
endstruct


That will compile in normal JASS to something like this:

JASS:

globals
integer nl_data_emapthy_alloc_
endglobals
function NL_DATA__empathy_ takes integer this returns nothing
endfunction


You know, a lot of random global blocks and random stuff. But it should show you that methods end up taking an integer called 'this'. If no one explained this yet, structs are integers.

JASS:

struct Data
integer lmao
endstruct
function onInit takes nothing returns nothing
    local Data data=Data.create()
    set data.lmao=3
endfunction


becomes->

JASS:

function onInit takes nothing returns nothing
    local integer data=nl_data__allocate()
    set lmao[data]=3
endfunction


See? this is just an integer pointing to a link in an array.
 

Ayanami

칼리
Reaction score
288
Thanks for the explanation. So is there any way to call a method in the Filter(function)?
 

decored

New Member
Reaction score
3
I suggest doing others as knockback requires timers struct etc for full effective. But if you can code in GUI i dont think you will ave a problem
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Thanks for the explanation. So is there any way to call a method in the Filter(function)?
Use a global to pass data.
You don't have to care about the MUIability, because it is instant.
 

roXplosive

New Member
Reaction score
15
I've just read this passage and i'm facepalming right now . I really don't get why Blizzard did structures this way since i know from programming (let's stick to C++) that an object is a data structure containing in order for each instance the member data as the type it is defined as and might get aditional fields that are pointers to polymorphic functions that are specific to the object if it is derived from a base class .

As for method calling the parameters passed to stack before calling are : pointer to the object calling the method named with "this" and the other function parameters .

So i'm asking the following questions about structures and similarities with C++ :

1) which is the default sharing of member data (default C++ is private)
2) is there a sharing parameter besides private and public like the "protected" of C++
3) can you declare abstract structures ? In C++ abstract structures can not have instances and their member functions are specified without parameters and ended with =0
4) the declarations of new structures is alike to the "Public" inhgeritance ? In c++ there are 3 types of inheritance : public : the new class has access to all the members of the base class can use all the data of the base class , protected : can use public and protected members of the base class and the members defined as protected in the base class become private here private inheritance turns all the data of the base struct into private regarding the new class , so deriving this class more would render the new objects unable to use the grandparent's class members
5) the C++ had a nice feature making possible to create eterogenous arrays using the inheritance of classes knowing that a pointer to a base class can point to a data of a derived type from the base
6) are restrictions to redefining methods of the base class in the classes inheriting it ?
 

Sevion

The DIY Ninja
Reaction score
413
Why are you posting this here?

And Blizzard did not make vJASS. Vexorian did.

1. Public with no prefix.
2. No.
3. No.
4. You prefix each member and method with the access level.
5. I'm sorry, but I don't understand. "eterogenous" is not an English word. If you mean two arrays that have the same values as a base array, then you have to manually clone the arrays.
6. If you want to redefine methods in child structs, you have to make the parent have stub methods.
 

Bribe

vJass errors are legion
Reaction score
67
Actually, Sevion, a "stub" method is mildly similar to a "protected" method, so #2 should not entirely be false.

I don't know how many of these features are unlockable in StarCraft 2, but there may be some room for this guy with the (Andromeda?) language.

vJass is semi-automatic with a lot of its functions. Things that are automatic with PHP, C++ can be done with certain libraries people have made. It may interest you that there is very little need for hashtables in most cases; people have found really useful methods of indexing data without the limitation of the pathetic 8192-sized array.
 

Sevion

The DIY Ninja
Reaction score
413
True, at that. My mistake.

Actually, all of these answers can be found in the JassHelper manual.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top