Orbiter MMU
FINAL(?) API
Universal-ish MMU add-on for the Orbiter spaceflight simulator.
|
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 oMMU * | GetInstance (VESSEL *hVessel) |
Instantiates an instance of the OMMUManagement class and then returns a pointer to this instance. More... | |
Protected Member Functions | |
oMMU () | |
OMMU Interface class.
|
inlineprotected |
|
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.
airlock | Reference to the airlock data structure that should be tied to this airlock. See sample code for example. |
|
pure virtual |
Adds the crew member specified by the given struct to the vessel if possible.
crewToAdd | a 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 |
|
pure virtual |
Adds an interaction area.
|
pure virtual |
EVA the crew member at the given index, out of the identified airlock (or the default airlock if non specified)
crewIndex | Index of the crew member to be EVA'd |
airlockIndex | Index of the airl ock to EVA from, |
|
pure virtual |
Creates an airlock based on an existing docking port.
portID | numeric ID of the docking port the airlock should be created against. |
openByDefault | Sets the airlock's default state. |
|
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.
airlockID | numeric ID of the airlock being queried |
airlockOut | Airlock struct to populate with state data. |
|
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.
index | Index to retrieve a crew member from |
crew | reference to the oMMUCrew structure to populate with crew data |
|
static |
Instantiates an instance of the OMMUManagement class and then returns a pointer to this instance.
hVessel | Vessel implementing OMMU, usually 'this' |
|
pure virtual |
Retrieves the interaction area identified by areaID to allow for state updates.
|
pure virtual |
Simulate OMMU crew functions - this should be called in clbkPreStep.
|
pure virtual |
|
pure virtual |
Removes the crew member at the given index.
index | The name of the crew member to remove from the vessel |
|
pure virtual |
|
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.
airlockState | Airlock struct indicating the new state of the airlock. |
|
pure virtual |
Sets the maximum amount of crew that the vessel is able to contain.
crewLimit | The new crew limit. |
|
pure virtual |
Updates the state data of the crew member at the given slot.
index | Index of the crew member to update |
crew | reference to the oMMUCrew structure containing the updated status. |
|
pure virtual |
Updates the interaction area identified by AreaID to the state contained in 'in'.
|
pure virtual |
Subscribe to reciving crew ingress events.
handler | Method meeting the OnCrewEnterHandler signature. |
|
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)
handler | Method meeting the OnInteractionHandler signature. |
|
pure virtual |
Subscribe to reciving crew transfer events.
handler | Method meeting the OnTransferCrewHandler signature. |
|
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.
crewIndex | Index of the crew member to be transfered. |
portIndex | Index of docking port to transfer to. |
|
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)
crewIndex | Index of the crew member to be transfered. |
targetHandle | VESSEL pointer of the targetted vessel. |
|
pure virtual |
Unsubscribe from reciving crew ingress events.
handler | Method meeting the OnCrewEnterHandler signature - Ideally one that has already been subscribed to the event handling system. |
|
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.
handler | Method meeting the OnInteractionHandler signature - Ideally one that has already been subscribed to the event handling system. |
|
pure virtual |
Unsubscribe from reciving crew transfer events.
handler | Method meeting the OnTransferCrewHandler signature - Ideally one that has already been subscribed to the event handling system. |