-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UEContext to carry context built from Unreal Engine needed for bl…
…ueprint generation
- Loading branch information
Showing
3 changed files
with
52 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace KismetAnalyzer; | ||
|
||
using Newtonsoft.Json; | ||
|
||
public class UEContext { | ||
[JsonProperty("classes")] | ||
public Dictionary<string, UEClass> Classes { get; init; } | ||
|
||
public static UEContext FromFile(string path) { | ||
using (StreamReader r = new StreamReader(path)) { | ||
return JsonConvert.DeserializeObject<UEContext>(r.ReadToEnd()); | ||
} | ||
} | ||
} | ||
|
||
public class UEClass { | ||
[JsonProperty("functions")] | ||
public Dictionary<string, UEFunction> Functions { get; init; } | ||
} | ||
|
||
public class UEFunction { | ||
[JsonProperty("pure")] | ||
public bool Pure; | ||
[JsonProperty("pins")] | ||
public IEnumerable<UEPin> Pins { get; init; } | ||
} | ||
|
||
public class UEPin { | ||
[JsonProperty("name")] | ||
public string Name; | ||
[JsonProperty("isRef")] | ||
public bool IsRef; | ||
[JsonProperty("direction")] | ||
public UEPinDirection Direction; | ||
} | ||
|
||
public enum UEPinDirection { | ||
[JsonProperty("input")] | ||
Input, | ||
[JsonProperty("output")] | ||
Output, | ||
} |