Class Constructors
From TrainzOnline
(Difference between revisions)
m (1 revision) |
m |
||
Line 1: | Line 1: | ||
− | *[[TrainzScript | + | *[[TrainzScript Language Reference|API Hierarchy]] |
**Constructors | **Constructors | ||
<br> | <br> |
Revision as of 02:20, 10 February 2010
- API Hierarchy
- Constructors
- 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.
Contents |
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