• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Encapsulation question about vJass.

Status
Not open for further replies.
Level 23
Joined
Feb 6, 2014
Messages
2,466
Scenario: I have a library that has structs in it but I want to use that struct in a global block and be private (limited to the library) at the same time, example:
JASS:
library A
    globals
        B something
    endglobals
  
    private struct B
    endstruct
  
endlibrary
^The does not compile because it shouldn't be private struct.
Is it possible? I assume Vexorian made it possible.
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,248
I tried a few things myself, none worked.
This was one thing I tried but it did not work, sadly.
JASS:
library A
    private struct B
		public static B something
    endstruct
endlibrary

library X
	function onInit takes nothing returns nothing
		set something = 1
	endfunction
endlibrary

The only thing I can come up with would be to do it the other way around. Basically making the struct public, but making every method/variable private.
 
Status
Not open for further replies.
Top