| Old revision #pnqweidrz | New revision #phvyja9wq | ||
|---|---|---|---|
| 1 | class | 1 | class CompanyValue extends GSController |
| 2 | { | 2 | { |
| 3 | |||
| 4 | function Start() | 3 | function Start() |
| 5 | { | 5 | function Save() |
| 6 | //This function is inside the class declaration. | ||
| 7 | } | ||
| 8 | |||
| 9 | //These are optional prototypes. Notice the ; at the end rather than {}. | ||
| 10 | //Squirrel doesn't require it, but some programmers like to use them. | ||
| 11 | function Save(); | ||
| 12 | function Load(version, data); | 5 | function Load(version, data); |
| 13 | } | 6 | } |
| 14 | 7 | ||
| 15 | function | 15 | function CompanyValue::Save() |
| 16 | { | 9 | { |
| 17 | GSLog.Info("//This function is outside the class declaration and requires the name of the class so squirrel can assign it to the right place.") | 17 | return{} |
| 18 | return {}; | ||
| 19 | } | 11 | } |
| 20 | 12 | ||
| 21 | function | 21 | function CompanyValue::Load(version, data) |
| 22 | { | 14 | { |
| 23 | |||
| 24 | } | 15 | } |
| 25 | 16 | ||
| 26 | function | 26 | function CompanyValue::Start() |
| 27 | { | 18 | { |
| 28 | local goal_reached = false | 19 | local goal_reached = false |
| 29 | while (true) { | 20 | while (true) { |