public static ThingPayload FromThing(Thing thing) { var payload = new ThingPayload(); ThingPayload.CopyFromThing(payload, thing); return(payload); }
public static DevicePayload FromDevice(Device device) { var item = new DevicePayload(); ThingPayload.CopyFromThing(item, device); LogicableItemUtils.CopyFromLogicable(item, device); return(item); }
public static ItemPayload FromItem(Item item) { var payload = new ItemPayload(); ThingPayload.CopyFromThing(payload, item); var slot = item.ParentSlot; if (slot != null) { payload.parentSlotReferenceId = slot.Parent.ReferenceId.ToString(); payload.parentSlotId = slot.SlotId; } payload.quantityText = item.GetQuantityText(); return(payload); }