• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Private keyword vs private struct (AutoIndex)

Status
Not open for further replies.
Level 14
Joined
Jul 26, 2008
Messages
1,009
Alright I'm using AutoIndex and recently picked up an inventory system that uses a slightly outdated version.

In the new version private keyword is used, but in the old version private struct is used. How would I go about pointing the following the right direction?

The error on compile is:

"getIndex is not a member of AutoIndex"

for line:

JASS:
        if AutoIndex.getIndex(u) == 0 then

See I've been looking through the OOP guide in tutorials, and the AutoIndex is in a whole nother function. Sounds like this only happens when it's .X# but this doesn't have any this. or .i issues.


JASS:
    static method getIndex takes unit u returns integer
        static if UseUnitUserData then
            return GetUnitUserData(u)
        else
            return LoadInteger(ht, 0, GetHandleId(u))
        endif
    endmethod //Resolves to an inlinable one-liner after the static if.

Above is the block in question just to prove it.


Thanks!
 
Last edited:
Status
Not open for further replies.
Top