-
Notifications
You must be signed in to change notification settings - Fork 16
DISGameManager
The DIS Game Manager contains the main portion of logic for the GRILL DIS plugin. It handles the tracking of DIS Entities in the game, spawning of new ones, and delegation of DIS packets to the appropriate DIS Entity. It also provides the main interface in the Details panel in Unreal Engine for users to modify DIS settings in.
class ADISGameManager
: public AInfo
- map
- CoreMinimal
- DISEnumsAndStructs.h
- PDUMasterInclude.h
- DISClassEnumMappings
- UDPSubsystem
- GameFramework/Info.h
Access | Type | Name | Description | |
---|---|---|---|---|
Public | int32 | ApplicationID | The Application ID of this application instance | |
Protected | bool | AutoConnectReceiveAddresses | Whether to automatically connect to all receive IP addresses | |
Protected | bool | AutoConnectSendAddresses | Whether to automatically connect to all send IP addresses | |
Protected | TMap<FEntityID, AActor*> | DISActorMappings | The mapping between DIS Entity IDs and corresponding entity actors | |
Public | UDISClassEnumMappings* | DISClassEnum | The DIS Enumeration Mapping to use for this manager | |
Protected | TMap<FEntityType, TSoftClassPtr<AActor>> | DISClassMappings | The mapping between DIS Enumerations and corresponding entity classes | |
Public | int32 | ExerciseID | The Exercise ID of the DIS sim | |
Private | AGeoReferencingSystem* | GeoReferencingSystem | The Unreal GeoReferencing sytem to use for the DIS sim | |
Public | TMap<AActor*, FInitialDISConditions> | InitialEntityConditions | Mapping for actor components to look up info on themselves during initialization. | |
Protected | std::map<FEntityID, AActor*> | RawDISActorMappings | The mapping between DIS Entity IDs and corresponding entity actors | |
Protected | std::map<FEntityType, TSoftClassPtr<AActor>> | RawDISClassMappings | The mapping between DIS Enumerations and corresponding entity classes | |
Protected | TArray<FReceiveSocketInfo> | ReceiveSocketsToSetup | Receive sockets to auto setup | |
Protected | TArray<FSendSocketInfo> | SendSocketsToSetup | Send sockets to auto setup | |
Public | int32 | SiteID | The Site ID of this application instance |
Name | Description |
---|---|
ADISGameManager | Default constructor |
Access | Return | Name | Description | |
---|---|---|---|---|
Public | bool | AddDISEntityToMap(FEntityID EntityIDToAdd, AActor EntityToAdd) | Adds a new entry to the DIS Entity map | |
Protected | Virtual | void | BeginPlay() | Overridable native event for when play begins for this actor |
Private | UDISReceiveComponent* | GetAssociatedDISComponent(FEntityID EntityIDIn) | Retrieves the DISReceiveComponent attached to the actor of the given ID | |
Public | Static | ADISGameManager | GetDISGameManager(UObject* WorldContextObject) | Gets a reference to the DIS Game Manager actor in the current open level |
Public | void | HandleDetonationPDU(FDetonationPDU DetonationPDUIn) | Delegates the given Detonation PDU to the appropriate DIS Entity actor | |
Public | void | HandleEntityStatePDU(FEntityStatePDU EntityStatePDUIn) | Delegates the given Entity State PDU to the appropriate DIS Entity actor | |
Public | void | HandleEntityStateUpdatePDU(FEntityStateUpdatePDU EntityStateUpdatePDUIn) | Delegates the given Entity State Update PDU to the appropriate DIS Entity actor | |
Public | void | HandleFirePDU(FFirePDU FirePDUIn) | Delegates the given Fire PDU to the appropriate DIS Entity actor | |
Protected | void | HandleOnDISEntityDestroyed(AActor* DestroyedActor) | Handles removal of the given actor from the DIS scenario mappings | |
Public | void | HandleRemoveEntityPDU(FRemoveEntityPDU RemoveEntityPDUIn) | Delegates the given Remove Entity PDU to the appropriate DIS Entity actor | |
Public | void | HandleStartResumePDU(FStartResumePDU StartResumePDUIn) | Delegates the given Start/Resume PDU to the appropriate DIS Entity actor | |
Public | void | HandleStopFreezePDU(FStopFreezePDU StopFreezePDUIn) | Delegates the given Stop/Freeze PDU to the appropriate DIS Entity actor | |
Public | bool | RemoveDISEntityFromMap(FEntityID EntityIDToRemove) | Removes the entry correlating to the given Entity ID from the DIS Entity map | |
Private | void | SpawnNewEntityFromEntityState(FEntityStatePDU EntityStatePDUIn) | Spawns a new Unreal actor for given Entity State PDU if mapping exists | |
Protected | virtual | void | Tick(float DeltaTime) | Function called every frame on this Actor |
Name | Description |
---|---|
FInitialDISConditions | Contains initial conditions for new DIS Entities. These are looked up on the DIS Receive Component during initialization. |
FReceiveSocketInfo | Contains all needed information for UDP receive sockets. |
FSendSocketInfo | Contains all needed information for UDP send sockets. |
int32 ApplicationID = 0
The Application ID of this application instance. Valid Application IDs range from 0 to 65535.
protected bool AutoconnectReceiveAddresses
Whether to automatically connect to all receive IP addresses.
Category: GRILL DIS|Game Manager|Networking
protected bool AutoconnectSendAddresses
Whether to automatically connect to all send IP addresses
Category: GRILL DIS|Game Manager|Networking
protected TMap<FEntityID, AActor*> DISActorMappings
The mapping between DIS Entity IDs and corresponding entity actors.
Category: GRILL DIS|Game Manager
public UDISCLassEnumMappings* DISClassEnum
The DIS Enumeration Mapping to use for this manager. This dictates the entity enumerations that will be recognized and managed by this DIS Game Manager.
Category: GRILL DIS|Game Manager
protected TMap<FEntityType, TSoftClassPtr<AActor>> DISClassMappings
The mapping between DIS Enumerations and corresponding entity classes.
Category: GRILL DIS|Game Manager
public int32 ExerciseID
The Exercise ID of the DIS sim. Valid Exercise IDs range from 0 to 255.
Category: GRILL DIS|Game Manager
private AGeoReferencingSystem* GeoReferencingSystem
The Unreal GeoReferencing sytem to use for the DIS sim.
public TMap<AActor*, FInitialDISConditions> InitialEntityConditions
Mapping for actor components to look up info on themselves during initialization.
protected std::map<FEntityID, AActor*> RawDISActorMappings
The mapping between DIS Entity IDs and corresponding entity actors.
Category: GRILL DIS|Game Manager
protected std::map<FEntityType, TSoftClassPtr<AActor>> RawDISClassMappings
The mapping between DIS Enumerations and corresponding entity classes.
Category: GRILL DIS|Game Manager
protected TArray<FReceiveSocketInfo> ReceiveSocketsToSetup
Receive sockets to auto setup. Only available if AutoConnectReceiveAddresses is set to true.
Category: GRILL DIS|Game Manager|Networking
protected TArray<FSendSocketInfo> SendSocketsToSetup
Send sockets to auto setup. Only available if AutoConnectSendAddresses is set to true.
Category: GRILL DIS|Game Manager|Networking
public int32 SiteID = 0
The Site ID of this application instance. Valid Site IDs range from 0 to 65535.
Category: GRILL DIS|Game Manager
public ADISGameManager()
Default constructor.
public bool AddDISEntityToMap
(
FEntityID EntityIDToAdd,
AActor* EntityToAdd
)
Adds a new entry to the DIS Entity map.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
EntityIDToAdd | The Entity ID to key the given entity under in the map |
EntityToAdd | The entity to add to the entity map |
Returns |
---|
True if the addition to the map was successful |
virtual void BeginPlay() override
Overridable native event for when play begins for this actor.
https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/GameFramework/AActor/BeginPlay/
private UDISReceiveComponent* GetAssociatedDISComponent
(
FEntityID EntityIDIn
)
Retrieves the DISReceiveComponent attached to the actor of the given ID.
Parameter | Description |
---|---|
EntityIDIn | The entity ID of the target actor |
Returns |
---|
The DISReceiveComponent attached to the actor of the given ID |
public static ADISGameManager* GetDISGameManager
(
UObject* WorldContextObject
)
Gets a reference to the DIS Game Manager actor in the current open level.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
WorldContextObject | Object to get a world object pointer from |
Returns |
---|
The reference to the Game Manager if one is found. Returns null if nothing is found or if multiple exist in the level |
public void HandleDetonationPDU
(
FDetonationPDU DetonationPDUIn
)
Delegates the given Detonation PDU to the appropriate DIS Entity actor.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
DetonationPDUIn | The Detonation PDU to pass to the appropriate entity |
public void HandleEntityStatePDU
(
FEntityStatePDU EntityStatePDUIn
)
Delegates the given Entity State PDU to the appropriate DIS Entity actor.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
EntityStatePDUIn | The Entity State PDU to pass to the appropriate entity |
public void HandleEntityStateUpdatePDU
(
FEntityStateUpdatePDU EntityStateUpdatePDUIn
)
Delegates the given Entity State Update PDU to the appropriate DIS Entity actor.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
EntityStateUpdatePDUIn | The Entity State Update PDU to pass to the appropriate entity |
public void HandleFirePDU
(
FFirePDU FirePDUIn
)
Delegates the given Fire PDU to the appropriate DIS Entity actor.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
FirePDUIn | The Fire PDU to pass to the appropriate entity |
protected void HandleOnDISEntityDestroyed
(
AActor* DestroyedActor
)
Handles removal of the given actor from the DIS scenario mappings.
Parameter | Description |
---|---|
DestroyedActor | Actor that was destroyed as part of the DIS scenario |
public void HandleRemoveEntityPDU
(
FRemoveEntityPDU RemoveEntityPDUIn
)
Delegates the given Remove Entity PDU to the appropriate DIS Entity actor.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
RemoveEntityPDUIn | The Remove Entity PDU to pass to the appropriate entity |
public void HandleStartResumePDU
(
FStartResumePDU StartResumePDUIn
)
Delegates the given Start/Resume PDU to the appropriate DIS Entity actor.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
StartResumePDUIn | The Start/Resume PDU to pass to the appropriate entity |
public void HandleStopFreezePDU
(
FStopFreezePDU StopFreezePDUIn
)
Delegates the given Stop/Freeze PDU to the appropriate DIS Entity actor.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
StopFreezePDUIn | The Stop/Freeze PDU to pass to the appropriate entity |
public bool RemoveDISEntityFromMap
(
FEntityID EntityIDToRemove
)
Removes the entry correlating to the given Entity ID from the DIS Entity map.
Category: GRILL DIS|Game Manager
Parameter | Description |
---|---|
EntityIDToRemove | The Entity ID of the DIS entity that needs removed from the entity map |
Returns |
---|
True if an entry was removed, false otherwise |
private void SpawnNewEntityFromEntityState
(
FEntityStatePDU EntityStatePDUIn
)
Spawns a new Unreal actor for given Entity State PDU if mapping exists.
Parameter | Description |
---|---|
EntityStatePDUIn | The entity state PDU representing the entity to spawn |
protected virtual void Tick
(
float DeltaTime
) override
Function called every frame on this Actor. Override this function to implement custom logic to be executed every frame. Note that Tick is disabled by default, and you will need to check PrimaryActorTick.bCanEverTick is set to true to enable it.
https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/GameFramework/AActor/Tick/
Parameter | Description |
---|---|
DeltaTime | Game time elapsed during last frame modified by the time dilation |