low priority queue, enums as low prio
All checks were successful
studiorailgun/highlevel-netcode-gen/pipeline/head This commit looks good

This commit is contained in:
austin 2024-08-10 19:58:10 -04:00
parent 1bb9cb1b35
commit 852251ce01
9 changed files with 21 additions and 15 deletions

View File

@ -29,7 +29,7 @@ public class Main {
public static boolean LOG = true;
//controls whether files are actually written to disk or not
public static boolean WRITE_TO_DISK = true;
public static boolean WRITE_TO_DISK = false;
//hard-coded white list files to always parse
static final String[] ALWAYS_PARSED_CLASSES = new String[]{
@ -82,6 +82,7 @@ public class Main {
*/
static List<TargetFile> getFilesToModify(String topLevelFolderPath){
List<TargetFile> rVal = new LinkedList<TargetFile>();
List<TargetFile> lowPriority = new LinkedList<TargetFile>();
File topLevelFolder = new File(topLevelFolderPath);
List<File> fileQueue = new LinkedList<File>();
List<File> fileQueueOpenSet = new LinkedList<File>();
@ -98,10 +99,14 @@ public class Main {
String content = "";
try {
content = Files.readString(currentFile.toPath());
if(
content.contains("@SynchronizedBehaviorTree") ||
isHardCodedAlwaysParse(currentFile.getName())
){
if(content.contains("@SynchronizedBehaviorTree")){
//get relative path
Path relativePath = topLevelFolder.toPath().relativize(currentFile.toPath());
String relativePathString = "src/main/java/electrosphere/" + relativePath.toString();
//parse
JavaClassSource source = parseJavaFile(content);
lowPriority.add(new TargetFile(currentFile.getAbsolutePath(), relativePathString, content, currentFile.getName(), source));
} else if(isHardCodedAlwaysParse(currentFile.getName())){
//get relative path
Path relativePath = topLevelFolder.toPath().relativize(currentFile.toPath());
String relativePathString = "src/main/java/electrosphere/" + relativePath.toString();
@ -126,6 +131,7 @@ public class Main {
fileQueue.remove(currentClosedFile);
}
}
rVal.addAll(lowPriority);
return rVal;
}

View File

@ -44,7 +44,7 @@ public class ClientAttach implements VirtualMethod {
@Override
public List<String> getImports(ProjectStructure projectStructure) {
List<String> rVal = Arrays.asList(new String[]{
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
});
return rVal;
}

View File

@ -44,8 +44,8 @@ public class ClientInterrupt implements VirtualMethod {
public List<String> getImports(ProjectStructure projectStructure) {
List<String> rVal = Arrays.asList(new String[]{
"electrosphere.net.parser.net.message.SynchronizationMessage",
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
"electrosphere.net.synchronization.ServerSynchronizationManager",
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
"electrosphere.net.synchronization.server.ServerSynchronizationManager",
});
return rVal;
}

View File

@ -44,8 +44,8 @@ public class ClientStart implements VirtualMethod {
public List<String> getImports(ProjectStructure projectStructure) {
List<String> rVal = Arrays.asList(new String[]{
"electrosphere.net.parser.net.message.SynchronizationMessage",
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
"electrosphere.net.synchronization.ServerSynchronizationManager",
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
"electrosphere.net.synchronization.server.ServerSynchronizationManager",
});
return rVal;
}

View File

@ -45,7 +45,7 @@ public class ServerAttach implements VirtualMethod {
public List<String> getImports(ProjectStructure projectStructure) {
List<String> rVal = Arrays.asList(new String[]{
"electrosphere.server.datacell.utils.ServerBehaviorTreeUtils",
"electrosphere.net.synchronization.BehaviorTreeIdEnums",
"electrosphere.net.synchronization.enums.BehaviorTreeIdEnums",
});
return rVal;
}

View File

@ -58,7 +58,7 @@ public class ServerFieldSetter implements VirtualMethod {
List<String> rVal = Arrays.asList(new String[]{
"electrosphere.net.parser.net.message.SynchronizationMessage",
"electrosphere.server.datacell.utils.DataCellSearchUtils",
"electrosphere.net.synchronization.FieldIdEnums",
"electrosphere.net.synchronization.enums.FieldIdEnums",
});
return rVal;
}

View File

@ -23,7 +23,7 @@ public class BTreeIdEnum extends VirtualClass {
super(
new TargetFile(
null,
"src/main/java/electrosphere/net/synchronization/BehaviorTreeIdEnums.java",
"src/main/java/electrosphere/net/synchronization/enums/BehaviorTreeIdEnums.java",
"",
"BehaviorTreeIdEnums",
null

View File

@ -23,7 +23,7 @@ public class FieldIdEnum extends VirtualClass {
super(
new TargetFile(
null,
"src/main/java/electrosphere/net/synchronization/FieldIdEnums.java",
"src/main/java/electrosphere/net/synchronization/enums/FieldIdEnums.java",
"",
"FieldIdEnums",
null

View File

@ -95,7 +95,7 @@ public class BTreeParser {
// ADD IMPORTS HERE
//
//
rVal.addImport("electrosphere.net.synchronization.BehaviorTreeIdEnums");
rVal.addImport("electrosphere.net.synchronization.enums.BehaviorTreeIdEnums");
}
//