diff options
author | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
---|---|---|
committer | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
commit | e6181c24124d97f2fbc932b8a68311e625463156 (patch) | |
tree | c1f097c344ca266b7941c9668590b0fd35c7870a /dsa/DSALib/Models/Network | |
parent | 2490ad5d31fe2ac778ff9303776f0e91f47a2862 (diff) |
Move dsa related stuff to subfolder
Diffstat (limited to 'dsa/DSALib/Models/Network')
-rw-r--r-- | dsa/DSALib/Models/Network/Command.cs | 18 | ||||
-rw-r--r-- | dsa/DSALib/Models/Network/CommandResponse.cs | 28 |
2 files changed, 46 insertions, 0 deletions
diff --git a/dsa/DSALib/Models/Network/Command.cs b/dsa/DSALib/Models/Network/Command.cs new file mode 100644 index 0000000..5a97e88 --- /dev/null +++ b/dsa/DSALib/Models/Network/Command.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using System.Linq; + +namespace DSALib.Models.Network +{ + public class Command + { + public ulong GroupId { get; set; } = 0; + public ulong CharId { get; set; } + public string Name { get; set; } + public string CmdIdentifier { get; set; } + public List<string> CmdTexts { get; set; } + public string CmdText => CmdTexts.Count != 0 ? CmdTexts.First() : ""; + + public int Cmdmodifier => CmdTexts.Count != 0 && int.TryParse(CmdTexts.Last(), out var mod) ? mod : 0; + public bool IsDm { get; set; } = false; + } +}
\ No newline at end of file diff --git a/dsa/DSALib/Models/Network/CommandResponse.cs b/dsa/DSALib/Models/Network/CommandResponse.cs new file mode 100644 index 0000000..0816e4a --- /dev/null +++ b/dsa/DSALib/Models/Network/CommandResponse.cs @@ -0,0 +1,28 @@ +using System; + +namespace DSALib.Models.Network +{ + public class CommandResponse + { + public CommandResponse(string message, ResponseType responseType = ResponseType.Broadcast) + { + this.message = message ?? throw new ArgumentNullException(nameof(message)); + ResponseType = responseType; + } + + public string message { get; } + public ResponseType ResponseType { get; } + + public override string ToString() + { + return message; + } + } + + public enum ResponseType + { + Broadcast, + Caller, + Error + } +}
\ No newline at end of file |