|
2 | 2 |
|
3 | 3 | # 1. Classes
|
4 | 4 |
|
5 |
| -Classes in MinitScript can be represented by maps, a constructed map with function assignments and/or definitions can be called object, see map section in 4.4. |
| 5 | +Classes in MinitScript can be represented by maps. |
| 6 | +A constructed map with function assignments and/or definitions can be called object, see map section in 4.4. |
6 | 7 |
|
7 | 8 | Creating a object in MinitScript works by using map initializer plus () -> methodName function assignment, or () -> { console.dump($this) } inline function definition.
|
8 |
| -Please see a example below. |
| 9 | +Please see the example below, which shows a object definition, which includes (private) member variables and member methods. |
| 10 | + |
| 11 | +Note that you can set member variables and member methods to private, if they are prefixed with a "-". |
| 12 | + |
9 | 13 |
|
10 | 14 | ```
|
11 | 15 | ...
|
12 | 16 | #
|
13 | 17 | $car = {
|
14 | 18 | # member variables
|
15 |
| - wheelCount: 4, |
16 |
| - color: "blue", |
17 |
| - horsePower: 75, |
| 19 | + -wheelCount: 4, |
| 20 | + -color: "blue", |
| 21 | + -horsePower: 75, |
18 | 22 | # member methods
|
19 | 23 | setWheelCount: ($wheelCount) ->
|
20 | 24 | {
|
@@ -45,6 +49,10 @@ Please see a example below.
|
45 | 49 | $wheelCount = $this.wheelCount
|
46 | 50 | $color = $this.color
|
47 | 51 | $horsePower = $this.horsePower
|
| 52 | + }, |
| 53 | + -somePrivateFunction: () -> |
| 54 | + { |
| 55 | + console.printLine("This just shows a private member function") |
48 | 56 | }
|
49 | 57 | }
|
50 | 58 | #
|
@@ -115,29 +123,25 @@ end
|
115 | 123 | #...
|
116 | 124 | ```
|
117 | 125 |
|
118 |
| -TODO: private properties, && argument prefix |
119 |
| - |
120 | 126 | # 2. Links
|
121 | 127 |
|
122 | 128 | ## 2.1. Language Documentation
|
123 |
| - - [Syntax](./README-Syntax.md) |
124 |
| - - [Data types](./README-DataTypes.md) |
125 |
| - - [Flow control - if, elseif, else](./README-FlowControl-Conditions.md) |
126 |
| - - [Flow Control - switch, case, default](./README-FlowControl-Conditions2.md) |
127 |
| - - [Flow Control - loops](./README-FlowControl-Loops.md) |
128 |
| - - [Classes](./README-Classes.md) |
129 |
| - - [Classes API](./README-Classes-API.md) |
130 |
| - - [Functions](./README-Functions.md) |
131 |
| - - [BuiltIn functions](./README-BuiltIn-Functions.md) |
132 |
| - - [Functions](./README-Functions.md) |
133 |
| - - [Operators](./README-Operators.md) |
134 |
| - - [Syntax](./README-Events.md) |
135 |
| - - [Events](./README-Constants.md) |
| 129 | +- [Syntax](./documentation/README-Syntax.md) |
| 130 | +- [DataTypes](./documentation/README-DataTypes.md) |
| 131 | +- [Flow control - if, elseif, else](./documentation/README-FlowControl-Conditions.md) |
| 132 | +- [Flow Control - switch, case, default](./documentation/README-FlowControl-Conditions2.md) |
| 133 | +- [Flow Control - loops](./documentation/README-FlowControl-Loops.md) |
| 134 | +- [Classes](./documentation/README-Classes.md) |
| 135 | +- [Classes API](./documentation/README-Classes-API.md) |
| 136 | +- [Functions](./documentation/README-Functions.md) |
| 137 | +- [BuiltIn functions](./documentation/README-BuiltIn-Functions.md) |
| 138 | +- [Modules](./documentation/README-Modules.md) |
| 139 | +- [Operators](./documentation/README-Operators.md) |
| 140 | +- [Constants](./documentation/README-Constants.md) |
136 | 141 |
|
137 | 142 | ## 2.2. Other Links
|
138 | 143 |
|
139 | 144 | - MinitScript, see [README.md](./README.md)
|
140 | 145 | - MinitScript - How to build, see [README-BuildingHowTo.md](./README-BuildingHowTo.md)
|
141 | 146 | - MinitScript - How to use, see [README-Tools.md](./README-Tools.md)
|
142 |
| -- MinitScript - ToDo list, see [README-ToDo.md](./README-ToDo.md) |
143 | 147 | - The Mindty Kollektiv [Discord Server](https://discord.gg/Na4ACaFD)
|
0 commit comments