-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from t3knomanzer/new-output-mode
New output mode
- Loading branch information
Showing
9 changed files
with
149 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Desktop/Application/MaxMix/Services/Communication/Message/MessageSetDefaultEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MaxMix.Services.Communication | ||
{ | ||
internal class MessageSetDefaultEndpoint : IMessage | ||
{ | ||
#region Constructor | ||
public MessageSetDefaultEndpoint() { } | ||
public MessageSetDefaultEndpoint(int id) | ||
{ | ||
_id = id; | ||
} | ||
#endregion | ||
|
||
#region Consts | ||
#endregion | ||
|
||
#region Fields | ||
private int _id; | ||
#endregion | ||
|
||
#region Properties | ||
public int Id { get => _id; } | ||
#endregion | ||
|
||
#region Private Methods | ||
#endregion | ||
|
||
#region Public Methods | ||
|
||
/* | ||
* --------------------------------------- | ||
* CHUNK TYPE SIZE (BYTES) | ||
* --------------------------------------- | ||
* ID INT32 4 | ||
* --------------------------------------- | ||
* 4 | ||
*/ | ||
|
||
public byte[] GetBytes() | ||
{ | ||
var result = new List<byte>(); | ||
result.AddRange(BitConverter.GetBytes(Id)); | ||
return result.ToArray(); | ||
} | ||
|
||
public bool SetBytes(byte[] bytes) | ||
{ | ||
var idBytes = bytes.Take(4).Reverse().ToArray(); | ||
_id = BitConverter.ToInt32(idBytes, 0); | ||
return true; | ||
} | ||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters