• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Private keyword vs private struct (AutoIndex)

Status
Not open for further replies.
Level 13
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