Class Constructors: Difference between revisions

From TrainzOnline
Jump to navigationJump to search
Andi06 (talk | contribs)
 
Danny252 (talk | contribs)
m Change link to library reference, not language reference
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
*[[TrainzScript Langage Reference|API Hierarchy]]
*[[TrainzScript Library Reference|API Hierarchy]]
**Constructors
**Constructors
<br>
<br>

Latest revision as of 13:47, 28 December 2020


  • A static class providing the ability to create instances of certain other classes from script.
  • Trainzscript does not normally allow game classs to be created in script, these methods allow for exceptions to this rule.
  • The implementation is liable to change.


GetTrainzAsset

public native Asset GetTrainzAsset(void)
Parameters
  • None
Returned Value
  • The global Trainz asset.
Notes
  • This method is used mainly by the built-in classes.


GetTrainzStrings

public native StringTable GetTrainzStrings(void)
Parameters
  • None
Returned Value
  • The global Trainz StringTable.
Notes
  • This method is used mainly by the built-in classes.


NewBrowser

public native Browser NewBrowser(void)
Parameters
  • None
Returned Value
  • A new empty Browser object.
Syntax
Browser browser = Constructors.NewBrowser();
Notes


NewDriverCommand

public native DriverCommand NewDriverCommand(Asset command)
Parameters
  • command = reference to a DriverCommand asset from which the new command instance will be constructed.
Returned Value
  • A new DriverCommand instance for script use.
Notes
  • This method does not add a new command to the list of available driver commands returned by World.GetDriverCommandList() but simply creates a script instance for private use.


NewDriverCommands

public native DriverCommands NewDriverCommands(void)
Parameters
  • None
Returned Value
  • A new empty DriverCommands list.
Notes


NewKUIDList

public native KUIDList NewKUIDList(void)
Parameters
  • None
Returned Value
  • A new KUIDList object, empty and unlocked.
Syntax
KUIDList consist = Constructors.NewKUIDList();
Notes


NewMenu

public native Menu NewMenu(void)
Parameters
  • None
Returned Value
  • A new empty Menu object.
Syntax
Menu menu = Constructors.NewMenu();
Notes
  • The menu returned is for setup purposes only, this method does not create any visual representation.


NewProductFilter

public native ProdutFilter NewProducFilter(void)
Parameters
  • None
Returned Value
  • A new ProdutFlter object, empty and unlocked.
Syntax
ProductFilter filter = Constructors.NewProductFilter();
Notes


NewSoup

public native Soup NewSoup(void)
Parameters
  • None
Returned Value
  • A new Soup object, empty and unlocked.
Syntax
Soup soup = Constructors.NewSoup();
Notes



Categories