Class AppEntityInfoToModel
- Namespace
- RustPlusApi.Extensions
- Assembly
- RustPlusApi.dll
Mapping extensions from protobuf entity messages to entity model types.
public static class AppEntityInfoToModel
- Inheritance
-
AppEntityInfoToModel
- Inherited Members
Methods
ToAlarmInfo(AppEntityInfo)
Maps an RustPlusContracts.AppEntityInfo of type Alarm to an AlarmInfo.
public static AlarmInfo ToAlarmInfo(this AppEntityInfo entity)
Parameters
entityAppEntityInfoThe protobuf entity info.
Returns
Exceptions
- InvalidOperationException
Thrown when the entity type is not
Alarm.
ToSmartSwitchInfo(AppEntityInfo)
Maps an RustPlusContracts.AppEntityInfo of type Switch to a SmartSwitchInfo.
public static SmartSwitchInfo ToSmartSwitchInfo(this AppEntityInfo entity)
Parameters
entityAppEntityInfoThe protobuf entity info.
Returns
Exceptions
- InvalidOperationException
Thrown when the entity type is not
Switch.
ToStorageMonitorInfo(AppEntityInfo)
Maps an RustPlusContracts.AppEntityInfo of type StorageMonitor to a StorageMonitorInfo.
public static StorageMonitorInfo ToStorageMonitorInfo(this AppEntityInfo entity)
Parameters
entityAppEntityInfoThe protobuf entity info.
Returns
Exceptions
- InvalidOperationException
Thrown when the entity type is not
StorageMonitor.
ToStorageMonitorItemInfo(Item)
Maps a single protobuf storage item to a StorageMonitorItemInfo.
public static StorageMonitorItemInfo ToStorageMonitorItemInfo(this AppEntityPayload.Item item)
Parameters
itemAppEntityPayload.ItemThe protobuf storage item.
Returns
ToStorageMonitorItemsInfo(IEnumerable<Item>)
Maps a sequence of protobuf storage items to StorageMonitorItemInfo instances.
public static IEnumerable<StorageMonitorItemInfo> ToStorageMonitorItemsInfo(this IEnumerable<AppEntityPayload.Item> items)
Parameters
itemsIEnumerable<AppEntityPayload.Item>The protobuf storage items to map.