client jump btree startint methods
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-07-31 17:33:59 -04:00
parent 8d6b4f71b8
commit 335ead8341
2 changed files with 26 additions and 2 deletions

View File

@ -21,7 +21,12 @@ import electrosphere.net.synchronization.annotation.SynchronizableEnum;
import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree; import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree;
import electrosphere.renderer.actor.Actor; import electrosphere.renderer.actor.Actor;
@SynchronizedBehaviorTree(name = "clientJumpTree", isServer = false, correspondingTree="serverJumpTree") @SynchronizedBehaviorTree(
name = "clientJumpTree",
isServer = false,
correspondingTree = "serverJumpTree",
genStartInt = true
)
/* /*
Behavior tree for jumping Behavior tree for jumping
*/ */
@ -75,7 +80,7 @@ public class ClientJumpTree implements BehaviorTree {
SynchronizationMessage.constructClientRequestBTreeActionMessage( SynchronizationMessage.constructClientRequestBTreeActionMessage(
Globals.clientSceneWrapper.mapClientToServerId(parent.getId()), Globals.clientSceneWrapper.mapClientToServerId(parent.getId()),
BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID, BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID,
1 0
) )
); );
} }
@ -278,4 +283,20 @@ public class ClientJumpTree implements BehaviorTree {
this.currentJumpForce = currentJumpForce; this.currentJumpForce = currentJumpForce;
} }
/**
* <p> Automatically generated </p>
* <p>
* Requests that the server start this btree
* </p>
*/
public void interrupt(){
Globals.clientConnection.queueOutgoingMessage(
SynchronizationMessage.constructClientRequestBTreeActionMessage(
Globals.clientSceneWrapper.mapClientToServerId(parent.getId()),
BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID,
1
)
);
}
} }

View File

@ -22,4 +22,7 @@ public @interface SynchronizedBehaviorTree {
//The corresponding behavior tree. If this is a server tree, it is the corresponding client tree. If this is a client tree, it is the corresponding server tree //The corresponding behavior tree. If this is a server tree, it is the corresponding client tree. If this is a client tree, it is the corresponding server tree
public String correspondingTree() default ""; public String correspondingTree() default "";
//If true, auto generation tooling will generate start() and interrupt() methods for this tree. SHOULD ONLY BE USED ON CLIENT
public boolean genStartInt() default false;
} }