View Single Post
Old 04-13-2009, 04:36 AM   #1545
dead_or_alivex
User
 
Join Date: Jun 2008
Posts: 72

dead_or_alivex has little to show at this moment (3)

Default

Just wondering, would it be difficult to implement function/method overloading?

Collapse JASS:
struct effectstruct
    effect fx = null

    static method create takes string modelpath, unit subject, string attachpt returns effectstruct
        // ...
        call AddSpecialEffectTarget(...)
        // ...
    endmethod

    static method create takes string modelpath, real x, real y returns effectstruct
        // ...
        call AddSpecialEffect(...)
        // ...
    endmethod
endstruct

The specific application I have in mind is overloading constructors, but I guess there could be others. It would be useful for systems and stuff.
dead_or_alivex is offline   Reply With Quote