Files
PlantBox/PlantBox.Shared/Communication/Commands/CommandSerializable.cs
Eveldee faa54aca0e Add CommandSerializable
Used to easily serialize class to CommandPacket
2019-03-22 19:57:33 +01:00

18 lines
447 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace PlantBox.Shared.Communication.Commands
{
public abstract class CommandSerializable<T>
{
public abstract string[] Serialize();
public abstract T Deserialize(string[] arguments);
public CommandPacket ToCommandPacket(Command command, ulong id)
{
return new CommandPacket(command, id, Serialize());
}
}
}