Skip to content

Commit 6b69775

Browse files
authored
Merge pull request #16 from Palatis/csharp_ReadBinByteArg
[c#] add ReadBinByteArg()
2 parents f4e9233 + 74a37cc commit 6b69775

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

extras/CSharp/CommandMessenger/ReceivedCommand.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,5 +355,21 @@ public bool ReadBinBoolArg()
355355
}
356356
return false;
357357
}
358-
}
358+
359+
/// <summary> Reads the current binary argument as a byte value. </summary>
360+
/// <returns> The boolean value. </returns>
361+
public byte ReadBinByteArg()
362+
{
363+
if (Next())
364+
{
365+
var current = BinaryConverter.ToByte(CmdArgs[_parameter]);
366+
if (current != null)
367+
{
368+
_dumped = true;
369+
return (byte)current;
370+
}
371+
}
372+
return 0;
373+
}
374+
}
359375
}

0 commit comments

Comments
 (0)