-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvJass Testings.j
More file actions
105 lines (80 loc) · 3.12 KB
/
Copy pathvJass Testings.j
File metadata and controls
105 lines (80 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//struct StructA
//static constant integer MyConstant = 1
//endstruct
//struct StructB
//static constant integer MyConstant = StructA.MyConstant
//endstruct
//Report this bug!
//----------------------------------------------------------------------------------------------------
//struct Struct1
//private boolean Element
//endstruct
//struct Struct2 extends Struct1
//method TestMethod takes nothing returns nothing
//set this.Element = true
//endmethod
//endstruct
//We need the protected keyword!
//library MyTestLibrary
////! private textmacro MyTextMacro
////! endtextmacro
//endlibrary
//We need private textmacros in libraries
//----------------------------------------------------------------------------------------------------
//type MyArray extends integer array[100]
//Mit .create erzeugen
//Mit .size Größe abfragen
//Missing enums:
//enum Number
//One = 1
//Two = 2
//endenum
//Das keyword class wäre angebrachter:
//class MyClass
//integer Bla = 0 //Automatisch private
//endclass
//function string::operator< takes string String1, string String2 returns boolean
//return (StringLength(String1) < StringLength(String2))
//endfunction
//----------------------------------------------------------------------------------------------------
//interface ParentStructInterface
//method test takes nothing returns nothing
//endinterface
//struct ParentStruct extends ParentStructInterface
//method test takes nothing returns nothing
//call DisplayTimedTextToPlayer(Player(0), 0.0, 0.0, 300.0, "JAAAAAAAAAA")
//endmethod
//endstruct
//struct ChildStruct extends ParentStruct
//method test takes nothing returns nothing
//call DisplayTimedTextToPlayer(Player(0), 0.0, 0.0, 300.0, "BLAAAAAAAAA")
//endmethod
//endstruct
//function testIt takes nothing returns nothing
//local ChildStruct this = ChildStruct.create()
//call this.test()
//call ParentStruct(this).test() //We can't use the superclass method, fixed since new release (super, stub)
//endfunction
//----------------------------------------------------------------------------------------------------
//struct Bla
//endstruct
//struct TestStruct
//static constant integer max = 100
//Bla array element[TestStruct.max] //We can't use struct constants if we have an array of custom type elements
//endstruct
//----------------------------------------------------------------------------------------------------
//struct MyStruct
//MyStruct.myFunctionInterface action
//function interface myFunctionInterface takes nothing returns nothing //Structs can't contain a function interface
//static method testFunction takes nothing returns nothing //Structs can't contain a function which uses a function interface
//endmethod
//static method create takes nothing returns MyStruct
//local MyStruct this = MyStruct.allocate()
//set this.action = MyStruct.testFunction.MyStruct.myFunctionInterface //Doesn't work
//return this
//endmethod
//endstruct
//----------------------------------------------------------------------------------------------------
//struct MyStruct extends array[MyStruct.maxSize] //Invalid
//public static constant integer maxSize = 10
//endstruct