-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor input/output classes to avoid naming conflicts in the genera…
…ted types
- Loading branch information
Showing
14 changed files
with
176 additions
and
176 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
2 changes: 1 addition & 1 deletion
2
OpenVR2WS/Input/RequestKeyEnum.cs → OpenVR2WS/Input/InputMessageKeyEnum.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
2 changes: 1 addition & 1 deletion
2
OpenVR2WS/Input/TypeEnum.cs → OpenVR2WS/Input/InputMessageTypeEnum.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace OpenVR2WS.Input; | ||
|
||
internal enum TypeEnum | ||
internal enum InputMessageTypeEnum | ||
{ | ||
None, | ||
String, | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
OpenVR2WS/Output/TypeEnum.cs → OpenVR2WS/Output/OuputTypeEnum.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace OpenVR2WS.Output; | ||
|
||
internal enum TypeEnum | ||
internal enum OuputTypeEnum | ||
{ | ||
None, | ||
String, | ||
|
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,65 @@ | ||
using OpenVR2WS.Input; | ||
using TypeGen.Core.TypeAnnotations; | ||
|
||
namespace OpenVR2WS.Output; | ||
|
||
[ExportTsInterface] | ||
internal class OutputMessage | ||
{ | ||
public OutputMessageTypeEnum Type = OutputMessageTypeEnum.Undefined; | ||
public InputMessageKeyEnum Key = InputMessageKeyEnum.None; | ||
public string Message = ""; | ||
public dynamic? Data = null; | ||
public string? Nonce = null; | ||
|
||
public static OutputMessage CreateError(string message, dynamic? shape = null, string? nonce = null) | ||
{ | ||
return new OutputMessage | ||
{ | ||
Type = OutputMessageTypeEnum.Error, | ||
Message = message, | ||
Data = shape, | ||
Nonce = nonce | ||
}; | ||
} | ||
|
||
public static OutputMessage CreateMessage(string message, string? nonce = null) | ||
{ | ||
return new OutputMessage | ||
{ | ||
Type = OutputMessageTypeEnum.Message, | ||
Message = message, | ||
Nonce = nonce | ||
}; | ||
} | ||
|
||
public static OutputMessage CreateCommand(InputMessageKeyEnum inputMessageKey, dynamic data, string? nonce = null) | ||
{ | ||
return new OutputMessage | ||
{ | ||
Type = OutputMessageTypeEnum.Result, | ||
Key = inputMessageKey, | ||
Data = data, | ||
Nonce = nonce | ||
}; | ||
} | ||
|
||
public static OutputMessage CreateVREvent(dynamic data) | ||
{ | ||
return new OutputMessage | ||
{ | ||
Type = OutputMessageTypeEnum.VREvent, | ||
Data = data | ||
}; | ||
} | ||
|
||
public static OutputMessage Create(OutputMessageTypeEnum type, dynamic data, string? nonce = null) | ||
{ | ||
return new OutputMessage | ||
{ | ||
Type = type, | ||
Data = data, | ||
Nonce = nonce | ||
}; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
OpenVR2WS/Output/ResponseTypeEnum.cs → OpenVR2WS/Output/OutputMessageTypeEnum.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace OpenVR2WS.Output; | ||
|
||
public enum ResponseTypeEnum | ||
public enum OutputMessageTypeEnum | ||
{ | ||
Undefined, | ||
Error, | ||
|
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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