Class InterlockingTower: Difference between revisions

From TrainzOnline
Jump to navigationJump to search
No edit summary
No edit summary
Line 24: Line 24:
Below is a list of some of the basic common functions on the InterlockingTower script class. This list is not intended to be comprehensive, merely provide an overview.
Below is a list of some of the basic common functions on the InterlockingTower script class. This list is not intended to be comprehensive, merely provide an overview.


{{MethodHeader|public InterlockingTowerPath CreateNewPath()}}
<br>{{MethodHeader|public InterlockingTowerPath CreateNewPath()}}
;Description
;Description
Creates a new blank path for use by this tower. Any script which needs to create a path should call this function. Any tower which needs to customise the class can then just override this to create their type.
Creates a new blank path for use by this tower. Any script which needs to create a path should call this function. Any tower which needs to customise the class can then just override this to create their type.
Line 30: Line 30:
*A newly created and initialised [[InterlockingTowerPath]] object.
*A newly created and initialised [[InterlockingTowerPath]] object.


{{MethodHeader|public string[] GetLocalisedPathNames()}}
<br>{{MethodHeader|public string[] GetLocalisedPathNames()}}
;Description
;Description
Returns a list of the current (localised) path names.
Returns a list of the current (localised) path names.
Line 36: Line 36:
*A string array, containing the localised names of every path.
*A string array, containing the localised names of every path.


{{MethodHeader|public InterlockingTowerPath FindPathByName(string pathName)}}
<br>{{MethodHeader|public InterlockingTowerPath FindPathByName(string pathName)}}
;Description
;Description
;Parameters
;Parameters
;Returns
;Returns


{{MethodHeader|public InterlockingTowerPath[] GetConflictingPaths(InterlockingTowerPath path)}}
<br>{{MethodHeader|public InterlockingTowerPath[] GetConflictingPaths(InterlockingTowerPath path)}}
;Description
;Description
;Parameters
;Parameters
;Returns
;Returns


{{MethodHeader|public mandatory void SetAIState(int aiState)}}
<br>{{MethodHeader|public mandatory void SetAIState(int aiState)}}
;Description
;Description
;Parameters
;Parameters
;Returns
;Returns


{{MethodHeader|public void AssignPathToTrain(Train train, string pathName)}}
<br>{{MethodHeader|public void AssignPathToTrain(Train train, string pathName)}}
;Description
;Description
;Parameters
;Parameters
;Returns
;Returns


{{MethodHeader|public void CancelPathForTrain(Train train, string pathName)}}
<br>{{MethodHeader|public void CancelPathForTrain(Train train, string pathName)}}
;Description
;Description
;Parameters
;Parameters
;Returns
;Returns


{{MethodHeader|public void SetPanicStateForPath(string pathName)}}
<br>{{MethodHeader|public void SetPanicStateForPath(string pathName)}}
;Description
;Description
;Parameters
;Parameters
;Returns
;Returns


{{MethodHeader|public void SetTrainAsPassing(Train train, Signal entrySignal)}}
<br>{{MethodHeader|public void SetTrainAsPassing(Train train, Signal entrySignal)}}
;Description
;Description
;Parameters
;Parameters
;Returns
;Returns

Revision as of 00:22, 14 October 2015

The InterlockingTower class is the script representation of an in game Interlocking Tower (aka Signal Tower). Interlocking Towers are used to define track "paths" that trains can travel down.




Common functions

Below is a list of some of the basic common functions on the InterlockingTower script class. This list is not intended to be comprehensive, merely provide an overview.


public InterlockingTowerPath CreateNewPath()
Description

Creates a new blank path for use by this tower. Any script which needs to create a path should call this function. Any tower which needs to customise the class can then just override this to create their type.

Returns


public string[] GetLocalisedPathNames()
Description

Returns a list of the current (localised) path names.

Returns
  • A string array, containing the localised names of every path.


public InterlockingTowerPath FindPathByName(string pathName)
Description
Parameters
Returns


public InterlockingTowerPath[] GetConflictingPaths(InterlockingTowerPath path)
Description
Parameters
Returns


public mandatory void SetAIState(int aiState)
Description
Parameters
Returns


public void AssignPathToTrain(Train train, string pathName)
Description
Parameters
Returns


public void CancelPathForTrain(Train train, string pathName)
Description
Parameters
Returns


public void SetPanicStateForPath(string pathName)
Description
Parameters
Returns


public void SetTrainAsPassing(Train train, Signal entrySignal)
Description
Parameters
Returns