-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.doml
59 lines (51 loc) · 1.37 KB
/
test.doml
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
// Construct a new Color
Test : Color {
RGB = 255, 64, 128,
}
// Constructors do exist
// the parameter names are purely for your own merit, they will check if its possible however (will be possible on most systems)
TheSame : Color::Normalized(r: 1, g: 0.25, b: 0.5) {
Name = "Bob"
}
// You can also just declare an object without scoping it
Other : Color
Other.Name = "X"
// You can also edit the original Test at any point EITHER by doing
Test.R = 50
// Or by doing
Test.{
G = 128
}
// You can declare arrays like
ArrayObject : []Color {
::Normalized(0.95, 0.55, 0.22){
Name = "Other", // Trailing commas are always allowed
},
// You can still do an empty construction
::() {
RGB = 50, 25, 125,
},
// And thus you can leave out the ::()
{
RGB = 50, 25, 125,
},
}
// You can also copy objects by doing
NewObj : Color = Other
// Or can do something like
NewObj.Name = ArrayObject[0].Name
// You can also declare arrays inside object definitions
MyTags : Tags {
// Note: all have to be of the same type
SetTags = ["Hello", "Other", "bits", "bobs", "kick"]
Name = MyTags.GetTags[0] // And indexing them works like you would think
}
// You can declare dictionaries like
// Dictionaries within objects can also be created similarly
MyDictionary : [String : Color] {
{
"Bob" : Color::Normalized(0.5, 1.2, 3.5) {
Name = "Bob's Color"
}
},
}