• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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