Class EntityChangedToModel
- Namespace
- RustPlusApi.Extensions
- Assembly
- RustPlusApi.dll
Mapping extensions from protobuf entity-changed broadcasts to event argument types.
public static class EntityChangedToModel
- Inheritance
-
EntityChangedToModel
- Inherited Members
Methods
ToEntityChangedEvent(AppEntityChanged)
Maps an RustPlusContracts.AppEntityChanged broadcast to the raw EntityChangedEventArg, preserving field presence (absent optional fields map to null).
public static EntityChangedEventArg ToEntityChangedEvent(this AppEntityChanged entityChanged)
Parameters
entityChangedAppEntityChangedThe protobuf entity-changed broadcast.
Returns
ToSmartDeviceEvent(AppEntityChanged)
Maps an RustPlusContracts.AppEntityChanged broadcast to a SmartDeviceEventArg. The broadcast carries no entity type, so this represents any binary-state smart device (a smart switch or a smart alarm).
public static SmartDeviceEventArg ToSmartDeviceEvent(this AppEntityChanged entityChanged)
Parameters
entityChangedAppEntityChangedThe protobuf entity-changed broadcast.
Returns
ToStorageMonitorEvent(AppEntityChanged)
Maps an RustPlusContracts.AppEntityChanged broadcast to a StorageMonitorEventArg.
public static StorageMonitorEventArg ToStorageMonitorEvent(this AppEntityChanged entityChanged)
Parameters
entityChangedAppEntityChangedThe protobuf entity-changed broadcast.