Orbiter MMU  FINAL(?) API
Universal-ish MMU add-on for the Orbiter spaceflight simulator.
oMMU_API::oMMU Class Referenceabstract

OMMU Interface class. More...

#include <oMMU_API.h>

Public Member Functions

Simulation

Simulation callbacks of OMMU - these should be placed at the top of their respective functions to ensure that they are called correctly.

virtual oMMUStatus ProcessClbkPreStep ()=0
 Simulate OMMU crew functions - this should be called in clbkPreStep. More...
 
virtual bool RecallState (const char *line)=0
 Recall oMMU crew state from the scenario file. More...
 
virtual void SaveState (FILEHANDLE scn)=0
 
Configuration

Configuration functions.

virtual oMMUStatus SetCrewLimit (int crewLimit)=0
 Sets the maximum amount of crew that the vessel is able to contain. More...
 
virtual int AddAirlock (const Airlock &airlock)=0
 Creates an arbitary airlock of the given parameters. most scenarios I would recomend using the CreateAirlockFromPort function to ease creation, as this handles creating the of the airlock and tying together the systems needed to allow for crew transfer. More...
 
virtual int CreateAirlockFromPort (int portID, bool initialState)=0
 Creates an airlock based on an existing docking port. More...
 
virtual oMMUStatus GetAirlockState (int airlockID, Airlock &airlockOut)=0
 Gets the current status of the airlock identified by airlockID, returns the status in the airlockOut struct. is most commonly used alongside SetAirlockState to update the state of an airlock. the airlockOut variable. More...
 
virtual oMMUStatus SetAirlockState (const Airlock &airlockState)=0
 Updates the state of the airlock identified by the airlockState structure. We do not pass an airlockID variable (or similar) here that is contained within the airlock struct. is most commonly used alongside GetAirlockState to update the state of an airlock. the airlockOut variable. More...
 
Crew Management

Crew management functions.

virtual oMMUStatus AddCrew (const oMMUCrew &crewToAdd, int slot=0)=0
 Adds the crew member specified by the given struct to the vessel if possible. More...
 
virtual oMMUStatus RemoveCrew (int index)=0
 Removes the crew member at the given index. More...
 
virtual oMMUStatus GetCrewState (int index, oMMUCrew &crew)=0
 Retrives the state data of the crew member at the given slot, this may be used to update the state of the given crew member (by calling SetCrew after modifying the structure) or to populate status displays. More...
 
virtual oMMUStatus SetCrewState (int index, const oMMUCrew &crew)=0
 Updates the state data of the crew member at the given slot. More...
 
virtual oMMUStatus BeginEVA (int crewIndex, int airlockIndex=0, bool setOnGround=false, bool setFocus=false)=0
 EVA the crew member at the given index, out of the identified airlock (or the default airlock if non specified) More...
 
virtual oMMUStatus TransferCrew (int crewIndex, int portIndex=0)=0
 Transfer the crew member at the given index to the vessel docked to the specified port. This will remove the crew member from the current vessel and transfer them to the other on sucess. More...
 
virtual oMMUStatus TransferCrew (int crewIndex, const VESSEL *targetVessel)=0
 Attempts to transfer the crew member at the given index to the vessel identified by targetHandle This will remove the crew member from the current vessel and transfer them to the other on sucess. This method should not be used for normal docked crew transfer, instead this is for special cases where crew needs to be sent between vessels without them having docked (e.g., transfering crew from a flying vessel to a vessel implementing the crew compliment of a surface base) More...
 
Crew Events

Methods related to the event system.

virtual void SubscribeTransferHandler (OnTransferCrewHandler handler)=0
 Subscribe to reciving crew transfer events. More...
 
virtual void UnsubscribeTransferHandler (OnTransferCrewHandler handler)=0
 Unsubscribe from reciving crew transfer events. More...
 
virtual void SubscribeIngressHandler (OnCrewEnterHandler handler)=0
 Subscribe to reciving crew ingress events. More...
 
virtual void UnsubscribeIngressHandler (OnCrewEnterHandler handler)=0
 Unsubscribe from reciving crew ingress events. More...
 
Interaction Areas

Allows for oMMU crew vessels to interact with other vessels via actions - Carry out repairs, start fires, deploy cargo, etc.

virtual int AddInteractionArea (const InteractionArea &area)=0
 Adds an interaction area. More...
 
virtual oMMUStatus GetInteractionArea (int areaID, InteractionArea &out)=0
 Retrieves the interaction area identified by areaID to allow for state updates. More...
 
virtual oMMUStatus SetInteractionAreaState (int areaID, const InteractionArea &in)=0
 Updates the interaction area identified by AreaID to the state contained in 'in'. More...
 
Interaction Events

Methods related to the event system.

virtual void SubscribeInteractionHandler (OnInteractionHandler handler)=0
 Subscribe to reciving interaction events - a vessel that implements interactable areas will usually subscribe to this only once, however allowence is made for 'n' subscribers to better allow for addons to implement their desired behaviours (e.g., XRRR style add-ons need the ability to subscribe at runtime to events taking place) More...
 
virtual void UnsubscribeInteractionHandler (OnInteractionHandler handler)=0
 Unsubscribe from reciving interaction events - This is only required if you need to stop listening at runtime, otherwise the core will ensure proper handling when the simulation ends. More...
 

Static Public Member Functions

Core

Core functions of OMMU - used for initialization / destruction of the OMMUManagement interface

static oMMUGetInstance (VESSEL *hVessel)
 Instantiates an instance of the OMMUManagement class and then returns a pointer to this instance. More...
 

Protected Member Functions

 oMMU ()
 

Detailed Description

OMMU Interface class.

Constructor & Destructor Documentation

◆ oMMU()

oMMU_API::oMMU::oMMU ( )
inlineprotected

Member Function Documentation

◆ AddAirlock()

virtual int oMMU_API::oMMU::AddAirlock ( const Airlock airlock)
pure virtual

Creates an arbitary airlock of the given parameters. most scenarios I would recomend using the CreateAirlockFromPort function to ease creation, as this handles creating the of the airlock and tying together the systems needed to allow for crew transfer.

Parameters
airlockReference to the airlock data structure that should be tied to this airlock. See sample code for example.
Returns
ID of the created airlock

◆ AddCrew()

virtual oMMUStatus oMMU_API::oMMU::AddCrew ( const oMMUCrew crewToAdd,
int  slot = 0 
)
pure virtual

Adds the crew member specified by the given struct to the vessel if possible.

Parameters
crewToAdda oMMUCrew structure containing the crew member to be added to the vessel
slot(OPTIONAL) Slot to insert the crew member at, if this parameter is ommited they will be inserted at the first crew slot in the vessel
Returns
OMMUStatus::CrewAdded on success, context specific failure message otherwise TODO : Deprecate? SetCrew can serve a similar purpose.

◆ AddInteractionArea()

virtual int oMMU_API::oMMU::AddInteractionArea ( const InteractionArea area)
pure virtual

Adds an interaction area.

Returns
internal ID - used for later retrival / update. This is not the interaction ID (Confusing, I know.)

◆ BeginEVA()

virtual oMMUStatus oMMU_API::oMMU::BeginEVA ( int  crewIndex,
int  airlockIndex = 0,
bool  setOnGround = false,
bool  setFocus = false 
)
pure virtual

EVA the crew member at the given index, out of the identified airlock (or the default airlock if non specified)

Parameters
crewIndexIndex of the crew member to be EVA'd
airlockIndexIndex of the airl ock to EVA from,
Returns
OMMUStatus message - EVASucess on sucess, context specific failure message otherwise

◆ CreateAirlockFromPort()

virtual int oMMU_API::oMMU::CreateAirlockFromPort ( int  portID,
bool  initialState 
)
pure virtual

Creates an airlock based on an existing docking port.

Parameters
portIDnumeric ID of the docking port the airlock should be created against.
openByDefaultSets the airlock's default state.
Returns
ID of the created airlock

◆ GetAirlockState()

virtual oMMUStatus oMMU_API::oMMU::GetAirlockState ( int  airlockID,
Airlock airlockOut 
)
pure virtual

Gets the current status of the airlock identified by airlockID, returns the status in the airlockOut struct. is most commonly used alongside SetAirlockState to update the state of an airlock. the airlockOut variable.

Parameters
airlockIDnumeric ID of the airlock being queried
airlockOutAirlock struct to populate with state data.
Returns
oMMUStatus indicating method return state.

◆ GetCrewState()

virtual oMMUStatus oMMU_API::oMMU::GetCrewState ( int  index,
oMMUCrew crew 
)
pure virtual

Retrives the state data of the crew member at the given slot, this may be used to update the state of the given crew member (by calling SetCrew after modifying the structure) or to populate status displays.

Parameters
indexIndex to retrieve a crew member from
crewreference to the oMMUCrew structure to populate with crew data
Returns
oMMUStatus::OK on sucessful retrival of a crew member, oMMUStatus::Empty if no crew member was present.

◆ GetInstance()

static oMMU* oMMU_API::oMMU::GetInstance ( VESSEL *  hVessel)
static

Instantiates an instance of the OMMUManagement class and then returns a pointer to this instance.

Parameters
hVesselVessel implementing OMMU, usually 'this'
Returns
Returns an instance of OMMU, or null if an error has occured

◆ GetInteractionArea()

virtual oMMUStatus oMMU_API::oMMU::GetInteractionArea ( int  areaID,
InteractionArea out 
)
pure virtual

Retrieves the interaction area identified by areaID to allow for state updates.

Returns
oMMUStatus::OK on Success

◆ ProcessClbkPreStep()

virtual oMMUStatus oMMU_API::oMMU::ProcessClbkPreStep ( )
pure virtual

Simulate OMMU crew functions - this should be called in clbkPreStep.

Returns
Not used at this time

◆ RecallState()

virtual bool oMMU_API::oMMU::RecallState ( const char *  line)
pure virtual

Recall oMMU crew state from the scenario file.

Parameters
line
Returns
Not used at this time

◆ RemoveCrew()

virtual oMMUStatus oMMU_API::oMMU::RemoveCrew ( int  index)
pure virtual

Removes the crew member at the given index.

Parameters
indexThe name of the crew member to remove from the vessel
Returns
OMMUStatus::OK on success, context specific failure message otherwise.

◆ SaveState()

virtual void oMMU_API::oMMU::SaveState ( FILEHANDLE  scn)
pure virtual

◆ SetAirlockState()

virtual oMMUStatus oMMU_API::oMMU::SetAirlockState ( const Airlock airlockState)
pure virtual

Updates the state of the airlock identified by the airlockState structure. We do not pass an airlockID variable (or similar) here that is contained within the airlock struct. is most commonly used alongside GetAirlockState to update the state of an airlock. the airlockOut variable.

Parameters
airlockStateAirlock struct indicating the new state of the airlock.
Returns
oMMUStatus indicating method return state.

◆ SetCrewLimit()

virtual oMMUStatus oMMU_API::oMMU::SetCrewLimit ( int  crewLimit)
pure virtual

Sets the maximum amount of crew that the vessel is able to contain.

Parameters
crewLimitThe new crew limit.
Returns
Returns CREW_LIMIT_CHANGE_SUCESS on sucess, -1 otherwise

◆ SetCrewState()

virtual oMMUStatus oMMU_API::oMMU::SetCrewState ( int  index,
const oMMUCrew crew 
)
pure virtual

Updates the state data of the crew member at the given slot.

Parameters
indexIndex of the crew member to update
crewreference to the oMMUCrew structure containing the updated status.
Returns
oMMUStatus::OK on sucessful update

◆ SetInteractionAreaState()

virtual oMMUStatus oMMU_API::oMMU::SetInteractionAreaState ( int  areaID,
const InteractionArea in 
)
pure virtual

Updates the interaction area identified by AreaID to the state contained in 'in'.

Returns
oMMUStatus::OK on Success

◆ SubscribeIngressHandler()

virtual void oMMU_API::oMMU::SubscribeIngressHandler ( OnCrewEnterHandler  handler)
pure virtual

Subscribe to reciving crew ingress events.

Parameters
handlerMethod meeting the OnCrewEnterHandler signature.
Returns
N/A

◆ SubscribeInteractionHandler()

virtual void oMMU_API::oMMU::SubscribeInteractionHandler ( OnInteractionHandler  handler)
pure virtual

Subscribe to reciving interaction events - a vessel that implements interactable areas will usually subscribe to this only once, however allowence is made for 'n' subscribers to better allow for addons to implement their desired behaviours (e.g., XRRR style add-ons need the ability to subscribe at runtime to events taking place)

Parameters
handlerMethod meeting the OnInteractionHandler signature.

◆ SubscribeTransferHandler()

virtual void oMMU_API::oMMU::SubscribeTransferHandler ( OnTransferCrewHandler  handler)
pure virtual

Subscribe to reciving crew transfer events.

Parameters
handlerMethod meeting the OnTransferCrewHandler signature.
Returns
N/A

◆ TransferCrew() [1/2]

virtual oMMUStatus oMMU_API::oMMU::TransferCrew ( int  crewIndex,
int  portIndex = 0 
)
pure virtual

Transfer the crew member at the given index to the vessel docked to the specified port. This will remove the crew member from the current vessel and transfer them to the other on sucess.

Parameters
crewIndexIndex of the crew member to be transfered.
portIndexIndex of docking port to transfer to.
Returns
OMMUStatus message - EVASucess on sucess, context specific failure message otherwise

◆ TransferCrew() [2/2]

virtual oMMUStatus oMMU_API::oMMU::TransferCrew ( int  crewIndex,
const VESSEL *  targetVessel 
)
pure virtual

Attempts to transfer the crew member at the given index to the vessel identified by targetHandle This will remove the crew member from the current vessel and transfer them to the other on sucess. This method should not be used for normal docked crew transfer, instead this is for special cases where crew needs to be sent between vessels without them having docked (e.g., transfering crew from a flying vessel to a vessel implementing the crew compliment of a surface base)

Parameters
crewIndexIndex of the crew member to be transfered.
targetHandleVESSEL pointer of the targetted vessel.
Returns
OMMUStatus message - EVASucess on sucess, context specific failure message otherwise

◆ UnsubscribeIngressHandler()

virtual void oMMU_API::oMMU::UnsubscribeIngressHandler ( OnCrewEnterHandler  handler)
pure virtual

Unsubscribe from reciving crew ingress events.

Parameters
handlerMethod meeting the OnCrewEnterHandler signature - Ideally one that has already been subscribed to the event handling system.
Returns
N/A

◆ UnsubscribeInteractionHandler()

virtual void oMMU_API::oMMU::UnsubscribeInteractionHandler ( OnInteractionHandler  handler)
pure virtual

Unsubscribe from reciving interaction events - This is only required if you need to stop listening at runtime, otherwise the core will ensure proper handling when the simulation ends.

Parameters
handlerMethod meeting the OnInteractionHandler signature - Ideally one that has already been subscribed to the event handling system.
Returns
N/A

◆ UnsubscribeTransferHandler()

virtual void oMMU_API::oMMU::UnsubscribeTransferHandler ( OnTransferCrewHandler  handler)
pure virtual

Unsubscribe from reciving crew transfer events.

Parameters
handlerMethod meeting the OnTransferCrewHandler signature - Ideally one that has already been subscribed to the event handling system.
Returns
N/A

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