Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
AlarmClockScenario Class Reference

Scenario manager for the Alarm Clock System More...

Inheritance diagram for AlarmClockScenario:
ScenarioModule IConfigNode

Classes

class  SpriteMap
 

Public Member Functions

override void OnAwake ()
 
override void OnLoad (ConfigNode node)
 
override void OnSave (ConfigNode node)
 
int OrderByUT (AlarmTypeBase alarm1, AlarmTypeBase alarm2)
 Comparer for UT based Sort More...
 
- Public Member Functions inherited from ScenarioModule
void Load (ConfigNode node)
 
void Save (ConfigNode node)
 

Static Public Member Functions

static bool AddAlarm (AlarmTypeBase newAlarm)
 Add an alarm to the list i the scenario More...
 
static bool AlarmExists (uint id)
 Try and get an alarm from the scenarios list More...
 
static AlarmTypeBase CreateAlarmByMapNodeType (MapObject.ObjectType nodeType)
 Create a new alarm from the type of a mapnode More...
 
static AlarmTypeBase CreateAlarmByType (Type alarmType)
 Create a new alarm of this type More...
 
static bool DeleteAlarm (AlarmTypeBase alarm)
 Delete an alarm from the list More...
 
static bool DeleteAlarm (uint id)
 Delete an alarm from the list More...
 
static AlarmTypeBase GetLastAlarm (double afterUT)
 Get the alarm that was triggered closest to the supplied time More...
 
static AlarmTypeBase GetNextAlarm ()
 Get the alarm that will be triggered next after the current time More...
 
static AlarmTypeBase GetNextAlarm (double afterUT)
 Get the alarm that will be triggered next after the supplied time More...
 
static AlarmTypeBase GetNextOrLastAlarm ()
 Get the alarm that will be triggered next after the current time, or if there is no future alarm, the previous one More...
 
static uint GetUniqueAlarmID ()
 Get a Unique ID for an alarm More...
 
static Texture2D LoadTexture (string textureName)
 Simplifies the action of loading a texture. More...
 
static bool MapNodeDefined (MapObject.ObjectType nodeType)
 Is there an alarm defined for this mapObject type More...
 
static void SortAlarmsByUTDescending ()
 Method to Sort the list More...
 
static bool TryGetAlarm (uint id, out AlarmTypeBase alarm)
 Try and get an alarm from the scenarios list More...
 

Public Attributes

DictionaryValueList< uint,
AlarmTypeBase
alarms
 The list of alarms stored for the alarm clock More...
 
int availableVesselChangeCooldown = 5
 Number of frames after a vessel change to wait before calcing orbit values, etc More...
 
int availableVesselChangeCooldownCounter = 0
 Counter for how many frames remaining before we reinstantiate updates More...
 
AlarmClockSettings settings
 Settings for the alarm clock per game More...
 
const string textureBaseUrl = "Squad/Alarms/Icons/"
 The default folder for icons that have no fully qualified path More...
 
double uiUpdatePeriod
 Period of game time (in seconds) when the UI updates should occur More...
 
float warpChangeIndicatorDuration = 3f
 How long should the warp change duration indicator last More...
 
float warpChangeTimeSafteyMultiplier = 1.2f
 How much safety there shoudl be around the timewarp rate change calcs More...
 
- Public Attributes inherited from ScenarioModule
ScenarioRunner runner
 
ProtoScenarioModule snapshot
 
List< GameScenestargetScenes
 

Properties

static SpriteMap AlarmSprites [get]
 The sprites for the various alarm types More...
 
static List< Type > AlarmTypes [get]
 The AlarmTypes that are available More...
 
static KSP.UI.Screens.AlarmClockApp AppInstance [get]
 Instance of the App thats running More...
 
static AlarmClockScenarioAudio AudioController [get]
 The sprites for the various alarm types More...
 
static Vessel AvailableVessel [get]
 The active or available vessel that can be used for alarms More...
 
static AlarmClockScenario Instance [get, set]
 Static singleton reference More...
 
bool IsAvailableVesselCooldownActive [get]
 Is the Available Vessel Change cooldown active More...
 
static bool IsVesselAvailable [get]
 Is there a vessel active or selected that can be used by alarms More...
 
static AlarmClockMessageDialog MessagePrefab [get]
 Prefab for the Message action of an alarm More...
 
static double UIUpdatePeriod [get]
 Period of game time (in seconds) when the UI updates should occur More...
 
bool WarpAffectIndicator [get, set]
 Is teh TimeWarp system under the influence of the alarm clock More...
 
- Properties inherited from ScenarioModule
int ClassID [get]
 
string ClassName [get]
 
BaseEventList Events [get]
 
BaseFieldList Fields [get]
 

Detailed Description

Scenario manager for the Alarm Clock System

Member Function Documentation

static bool AlarmClockScenario.AddAlarm ( AlarmTypeBase  newAlarm)
inlinestatic

Add an alarm to the list i the scenario

Parameters
newAlarmThe alarm to add
Returns
True if it added
static bool AlarmClockScenario.AlarmExists ( uint  id)
inlinestatic

Try and get an alarm from the scenarios list

Parameters
idiD of the alarm
alarmThe returned alarm
Returns
True if the alarmid was found
static AlarmTypeBase AlarmClockScenario.CreateAlarmByMapNodeType ( MapObject.ObjectType  nodeType)
inlinestatic

Create a new alarm from the type of a mapnode

Parameters
nodeTypeThe node type to search for
Returns
A new alarm, or null if cannot be created
static AlarmTypeBase AlarmClockScenario.CreateAlarmByType ( Type  alarmType)
inlinestatic

Create a new alarm of this type

Parameters
alarmTypeThe type of alarm
Returns
Null if tcannot create it
static bool AlarmClockScenario.DeleteAlarm ( AlarmTypeBase  alarm)
inlinestatic

Delete an alarm from the list

Parameters
alarmThe alarm to delete
Returns
True if successful
static bool AlarmClockScenario.DeleteAlarm ( uint  id)
inlinestatic

Delete an alarm from the list

Parameters
idThe id of the alarm to delete
Returns
True if successful
static AlarmTypeBase AlarmClockScenario.GetLastAlarm ( double  afterUT)
inlinestatic

Get the alarm that was triggered closest to the supplied time

Parameters
afterUTThe UT to look for the previous alarm before
Returns
The previous alarm, or null if there is none
static AlarmTypeBase AlarmClockScenario.GetNextAlarm ( )
inlinestatic

Get the alarm that will be triggered next after the current time

Returns
The next alarm, or null if there is none
static AlarmTypeBase AlarmClockScenario.GetNextAlarm ( double  afterUT)
inlinestatic

Get the alarm that will be triggered next after the supplied time

Parameters
afterUTThe UT to look for the next alarm after
Returns
The next alarm, or null if there is none
static AlarmTypeBase AlarmClockScenario.GetNextOrLastAlarm ( )
inlinestatic

Get the alarm that will be triggered next after the current time, or if there is no future alarm, the previous one

Returns
The desired alarm, or null if there is none
static uint AlarmClockScenario.GetUniqueAlarmID ( )
inlinestatic

Get a Unique ID for an alarm

Returns
static Texture2D AlarmClockScenario.LoadTexture ( string  textureName)
inlinestatic

Simplifies the action of loading a texture.

Parameters
textureNameName of the texture.
Returns
A Unity texture.
static bool AlarmClockScenario.MapNodeDefined ( MapObject.ObjectType  nodeType)
inlinestatic

Is there an alarm defined for this mapObject type

Parameters
nodeTypeThe node type to search for
Returns
True if it is defined
override void AlarmClockScenario.OnAwake ( )
inlinevirtual

< in case destroy-on-scene-change fails

Reimplemented from ScenarioModule.

override void AlarmClockScenario.OnLoad ( ConfigNode  node)
inlinevirtual

Reimplemented from ScenarioModule.

override void AlarmClockScenario.OnSave ( ConfigNode  node)
inlinevirtual

Reimplemented from ScenarioModule.

int AlarmClockScenario.OrderByUT ( AlarmTypeBase  alarm1,
AlarmTypeBase  alarm2 
)
inline

Comparer for UT based Sort

static void AlarmClockScenario.SortAlarmsByUTDescending ( )
inlinestatic

Method to Sort the list

static bool AlarmClockScenario.TryGetAlarm ( uint  id,
out AlarmTypeBase  alarm 
)
inlinestatic

Try and get an alarm from the scenarios list

Parameters
idiD of the alarm
alarmThe returned alarm
Returns
True if the alarmid was found

Member Data Documentation

DictionaryValueList<uint, AlarmTypeBase> AlarmClockScenario.alarms

The list of alarms stored for the alarm clock

int AlarmClockScenario.availableVesselChangeCooldown = 5

Number of frames after a vessel change to wait before calcing orbit values, etc

int AlarmClockScenario.availableVesselChangeCooldownCounter = 0

Counter for how many frames remaining before we reinstantiate updates

AlarmClockSettings AlarmClockScenario.settings

Settings for the alarm clock per game

const string AlarmClockScenario.textureBaseUrl = "Squad/Alarms/Icons/"

The default folder for icons that have no fully qualified path

double AlarmClockScenario.uiUpdatePeriod

Period of game time (in seconds) when the UI updates should occur

float AlarmClockScenario.warpChangeIndicatorDuration = 3f

How long should the warp change duration indicator last

float AlarmClockScenario.warpChangeTimeSafteyMultiplier = 1.2f

How much safety there shoudl be around the timewarp rate change calcs

Property Documentation

SpriteMap AlarmClockScenario.AlarmSprites
staticget

The sprites for the various alarm types

List<Type> AlarmClockScenario.AlarmTypes
staticget

The AlarmTypes that are available

KSP.UI.Screens.AlarmClockApp AlarmClockScenario.AppInstance
staticget

Instance of the App thats running

AlarmClockScenarioAudio AlarmClockScenario.AudioController
staticget

The sprites for the various alarm types

Vessel AlarmClockScenario.AvailableVessel
staticget

The active or available vessel that can be used for alarms

AlarmClockScenario AlarmClockScenario.Instance
staticgetset

Static singleton reference

bool AlarmClockScenario.IsAvailableVesselCooldownActive
get

Is the Available Vessel Change cooldown active

bool AlarmClockScenario.IsVesselAvailable
staticget

Is there a vessel active or selected that can be used by alarms

Returns
AlarmClockMessageDialog AlarmClockScenario.MessagePrefab
staticget

Prefab for the Message action of an alarm

double AlarmClockScenario.UIUpdatePeriod
staticget

Period of game time (in seconds) when the UI updates should occur

bool AlarmClockScenario.WarpAffectIndicator
getset

Is teh TimeWarp system under the influence of the alarm clock


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