Loading

Revision differences

Old revision #pnqweidrzNew revision #phvyja9wq
1class MyNewGS extends GSController  1class 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  
15function MyNewGS::Save()  15function 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  
21function MyNewGS::Load(version, data)  21function CompanyValue::Load(version, data)
22{  14{  
23  GSLog.Info("Load")    
24}  15}  
25  16  
26function MyNewGS::Start()  26function CompanyValue::Start()
27{  18{  
28 local goal_reached = false  19 local goal_reached = false  
29  while (true) {  20  while (true) {