[ZinC] Stub methods?

muzzel

New Member
Reaction score
1
Hello,
im trying to use stub methods in ZinC, just like in vJass, but they just wont work. Im not sure whether ZinC just doesnt support them (quite unlikely) or the keyword is different / im using it the wrong way.

Here is my test code:
Code:
//! zinc
library Test {
    struct A {
        stub method whatever() {
            BJDebugMsg("Whatever a");
        }
    }
    
    struct B extends A {
        method whatever() {
            BJDebugMsg("Whatever b");
        }
    }
    
    function onInit() {
        B myB = B.create();
        myB.whatever();
    }
}
//! endzinc

Error is:
Unexpected: "method"
so he doesnt recognize stub as a keyword.
 

Solmyr

Ultra Cool Member
Reaction score
30
You are correct, there are no stub methods in Zinc.

Use interfaces instead.
 

muzzel

New Member
Reaction score
1
Hm thats ugly, i actually need "abstract structs" to forbit instantiation of the superstruct anyway, so interfaces make sense.

Thx
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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