Add reset command to test out new abstract PixelCommand class implementation.

This commit is contained in:
Starbeamrainbowlabs 2017-02-26 20:30:51 +00:00
parent ea7d72ab4a
commit 2271f52d1e
3 changed files with 29 additions and 1 deletions

View file

@ -65,7 +65,7 @@ namespace PixelHub
/// <summary>
/// The payload of the message.
/// </summary>
public abstract byte[] Payload { get; }
public abstract byte[] Payload { get; protected set; }
public PixelCommand()
{

View file

@ -0,0 +1,26 @@
using System;
namespace PixelHub.Server.PixelCommands
{
/// <summary>
/// Hard-resets the PixelBot. Useful if something has gone wrong, or to reset it's internal state.
/// Note that this will cause the PixelBot to drop it's connection!
/// </summary>
public class ResetCommand : PixelCommand
{
public override byte[] Payload {
get {
return new byte[0];
}
protected set {
// There's nothing here!
}
}
public ResetCommand()
{
}
}
}

View file

@ -43,9 +43,11 @@
<Compile Include="PixelCommand.cs" />
<Compile Include="PixelBot.cs" />
<Compile Include="NetTools.cs" />
<Compile Include="PixelCommands\ResetCommand.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="SBRL.Utilities\" />
<Folder Include="PixelCommands\" />
</ItemGroup>
</Project>