Custom Asteroids  1.1.0
A mod for Kerbal Space Program that lets users control where asteroids appear
 All Classes Namespaces Files Functions Variables Enumerations Properties Pages
SpawnCatcher Class Reference

Class for identifying and manipulating new asteroids before they are seen by the player. More...

+ Inheritance diagram for SpawnCatcher:

Public Member Functions

void Start ()
 Called on the frame when a script is enabled just before any of the Update methods is called the first time. More...
 
void OnDestroy ()
 This function is called when the object will be destroyed. More...
 

Package Functions

void catchAsteroidSpawn (Vessel vessel)
 Selects newly created asteroids and forwards them to AsteroidManager for processing. More...
 

Detailed Description

Class for identifying and manipulating new asteroids before they are seen by the player.

Invariant
At most one instance of this class exists
If and only if an instance of this class edists, SpawnCatcher.CatchAsteroidSpawn() will be called whenever a new vessel is created
Warning
Assumes that Space Center, Tracking Station, and Flight are the only real-time scenes. May be invalidated by the addition of a Mission Control or Observatory scene in KSP 0.24.

Member Function Documentation

void catchAsteroidSpawn ( Vessel  vessel)
package

Selects newly created asteroids and forwards them to AsteroidManager for processing.

Parameters
[in]vesselA newly created ship object
Postcondition
if vessel is an asteroid, its properties are modified using AsteroidManager. Otherwise, the function has no effect.
Note
if AsteroidManager cannot generate new data for the asteroid, the asteroid is destroyed. This policy is intended to minimize side effects while alerting the player to the presence of a bug.
Exception Safety
Does not throw exceptions
void OnDestroy ( )

This function is called when the object will be destroyed.

See Also
Unity Documentation
Postcondition
SpawnCatcher.CatchAsteroidSpawn() will no longer be called whenever a new vessel is created
Todo:
What exceptions are thrown by GameEvents.onVesselCreate.*?
void Start ( )

Called on the frame when a script is enabled just before any of the Update methods is called the first time.

See Also
Unity Documentation
Postcondition
SpawnCatcher.CatchAsteroidSpawn() will henceforth be called whenever a new vessel is created
Todo:
What exceptions are thrown by GameEvents.onVesselCreate.*?

The documentation for this class was generated from the following file: