Stores raw asteroid data.
More...
Stores raw asteroid data.
- Invariant
- At most one instance of this class exists
- Todo:
- Clean up this class
Creates an uninitialized solar system.
- Postcondition
- No asteroids will be created
- Exception Safety
- Does not throw exceptions.
Randomly selects an asteroid population.
The selection is weighted by the spawn rate of each population; a population with a rate of 2.0 is twice as likely to be chosen as one with a rate of 1.0.
- Returns
- A reference to the selected population
- Exceptions
-
System.InvalidOperationException | Thrown if there are no populations from which to choose one, or if all spawn rates are zero, or if any rate is negative |
- Exception Safety
- Does not throw exceptions
Returns the total spawn rate of all asteroid populations.
Currently only needed for normalizing the asteroid selection.
- Returns
- The sum of all spawn rates for all populations.
- Exception Safety
- Does not throw exceptions
Factory method obtaining Custom Asteroids settings from a config file.
- Returns
- A newly constructed PopulationLoader object containing up-to-date settings from the Custom Asteroids config file, or the default settings if no such file exists.
- Exceptions
-
Throws | System.TypeInitializationException if the PopulationLoader object could not be constructed |
- Exception Safety
- The program is in a consistent state in the event of an exception
- Todo:
- Can I make Load() atomic?
The documentation for this class was generated from the following file: