sync btree constructor refactor
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
236c7f0c51
commit
6cf8edf9f2
@ -94,7 +94,7 @@ public class ClientAttackTree implements BehaviorTree {
|
|||||||
String projectileToFire = null;
|
String projectileToFire = null;
|
||||||
String attackingPoint = null;
|
String attackingPoint = null;
|
||||||
|
|
||||||
public ClientAttackTree(Entity e){
|
private ClientAttackTree(Entity e, Object ... params){
|
||||||
setState(AttackTreeState.IDLE);
|
setState(AttackTreeState.IDLE);
|
||||||
setDriftState(AttackTreeDriftState.NO_DRIFT);
|
setDriftState(AttackTreeDriftState.NO_DRIFT);
|
||||||
parent = e;
|
parent = e;
|
||||||
@ -461,16 +461,14 @@ public class ClientAttackTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientAttackTree attachTree(Entity parent){
|
public static ClientAttackTree attachTree(Entity parent, Object ... params){
|
||||||
ClientAttackTree rVal = new ClientAttackTree(parent);
|
ClientAttackTree rVal = new ClientAttackTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTATTACKTREE, rVal);
|
parent.putData(EntityDataStrings.TREE_CLIENTATTACKTREE, rVal);
|
||||||
Globals.clientScene.registerBehaviorTree(rVal);
|
Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal);
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTATTACKTREE_ID);
|
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTATTACKTREE_ID);
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,7 +80,7 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
String projectileToFire = null;
|
String projectileToFire = null;
|
||||||
String attackingPoint = null;
|
String attackingPoint = null;
|
||||||
|
|
||||||
public ServerAttackTree(Entity e){
|
private ServerAttackTree(Entity e, Object ... params){
|
||||||
state = AttackTreeState.IDLE;
|
state = AttackTreeState.IDLE;
|
||||||
driftState = AttackTreeDriftState.NO_DRIFT;
|
driftState = AttackTreeDriftState.NO_DRIFT;
|
||||||
parent = e;
|
parent = e;
|
||||||
@ -517,9 +517,10 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerAttackTree attachTree(Entity parent){
|
public static ServerAttackTree attachTree(Entity parent, Object ... params){
|
||||||
ServerAttackTree rVal = new ServerAttackTree(parent);
|
ServerAttackTree rVal = new ServerAttackTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -49,9 +49,9 @@ public class ClientBlockTree implements BehaviorTree {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
private ClientBlockTree(Entity parent, BlockSystem blockSystem){
|
private ClientBlockTree(Entity parent, Object ... params){
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.blockSystem = blockSystem;
|
this.blockSystem = (BlockSystem)params[0];
|
||||||
this.stateTransitionUtil = StateTransitionUtil.create(parent, false, new StateTransitionUtilItem[]{
|
this.stateTransitionUtil = StateTransitionUtil.create(parent, false, new StateTransitionUtilItem[]{
|
||||||
StateTransitionUtilItem.create(
|
StateTransitionUtilItem.create(
|
||||||
BlockState.WIND_UP,
|
BlockState.WIND_UP,
|
||||||
@ -129,12 +129,10 @@ public class ClientBlockTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientBlockTree attachTree(Entity parent, BlockSystem blockSystem){
|
public static ClientBlockTree attachTree(Entity parent, Object ... params){
|
||||||
ClientBlockTree rVal = new ClientBlockTree(parent, blockSystem);
|
ClientBlockTree rVal = new ClientBlockTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTBLOCKTREE, rVal);
|
parent.putData(EntityDataStrings.TREE_CLIENTBLOCKTREE, rVal);
|
||||||
|
|||||||
@ -44,9 +44,9 @@ public class ServerBlockTree implements BehaviorTree {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
private ServerBlockTree(Entity parent, BlockSystem blockSystem){
|
private ServerBlockTree(Entity parent, Object ... params){
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.blockSystem = blockSystem;
|
this.blockSystem = (BlockSystem)params[0];
|
||||||
this.stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{
|
this.stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{
|
||||||
StateTransitionUtilItem.create(
|
StateTransitionUtilItem.create(
|
||||||
BlockState.WIND_UP,
|
BlockState.WIND_UP,
|
||||||
@ -156,9 +156,10 @@ public class ServerBlockTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerBlockTree attachTree(Entity parent, BlockSystem blockSystem){
|
public static ServerBlockTree attachTree(Entity parent, Object ... params){
|
||||||
ServerBlockTree rVal = new ServerBlockTree(parent, blockSystem);
|
ServerBlockTree rVal = new ServerBlockTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,8 @@ public class ClientEquipState implements BehaviorTree {
|
|||||||
* @param parent the entity this is attached to
|
* @param parent the entity this is attached to
|
||||||
* @param equipPoints the list of available points
|
* @param equipPoints the list of available points
|
||||||
*/
|
*/
|
||||||
private ClientEquipState(Entity parent, List<EquipPoint> equipPoints){
|
private ClientEquipState(Entity parent, Object ... params){
|
||||||
|
List<EquipPoint> equipPoints = (List)params[0];
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
for(EquipPoint point : equipPoints){
|
for(EquipPoint point : equipPoints){
|
||||||
this.equipPoints.add(point);
|
this.equipPoints.add(point);
|
||||||
@ -418,16 +419,14 @@ public class ClientEquipState implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientEquipState attachTree(Entity parent, List<EquipPoint> equipPoints){
|
public static ClientEquipState attachTree(Entity parent, Object ... params){
|
||||||
ClientEquipState rVal = new ClientEquipState(parent, equipPoints);
|
ClientEquipState rVal = new ClientEquipState(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTEQUIPSTATE, rVal);
|
parent.putData(EntityDataStrings.TREE_CLIENTEQUIPSTATE, rVal);
|
||||||
Globals.clientScene.registerBehaviorTree(rVal);
|
Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal);
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTEQUIPSTATE_ID);
|
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTEQUIPSTATE_ID);
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,8 @@ public class ServerEquipState implements BehaviorTree {
|
|||||||
//the map of equip point id -> entity equipped at said point
|
//the map of equip point id -> entity equipped at said point
|
||||||
Map<String,Entity> equipMap = new HashMap<String,Entity>();
|
Map<String,Entity> equipMap = new HashMap<String,Entity>();
|
||||||
|
|
||||||
public ServerEquipState(Entity parent, List<EquipPoint> equipPoints){
|
public ServerEquipState(Entity parent, Object ... params){
|
||||||
|
List<EquipPoint> equipPoints = (List)params[0];
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
for(EquipPoint point : equipPoints){
|
for(EquipPoint point : equipPoints){
|
||||||
this.equipPoints.add(point);
|
this.equipPoints.add(point);
|
||||||
@ -430,9 +431,10 @@ public class ServerEquipState implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerEquipState attachTree(Entity parent, List<EquipPoint> equipPoints){
|
public static ServerEquipState attachTree(Entity parent, Object ... params){
|
||||||
ServerEquipState rVal = new ServerEquipState(parent, equipPoints);
|
ServerEquipState rVal = new ServerEquipState(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -51,12 +51,13 @@ public class ClientGravityTree implements BehaviorTree {
|
|||||||
|
|
||||||
List<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
|
List<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
|
||||||
|
|
||||||
private ClientGravityTree(Entity e, Collidable collidable, DBody body, int fallFrame){
|
private ClientGravityTree(Entity e, Object ... params){
|
||||||
|
//Collidable collidable, DBody body, int fallFrame
|
||||||
state = GravityTreeState.ACTIVE;
|
state = GravityTreeState.ACTIVE;
|
||||||
parent = e;
|
parent = e;
|
||||||
this.body = body;
|
this.collidable = (Collidable)params[0];
|
||||||
this.collidable = collidable;
|
this.body = (DBody)params[1];
|
||||||
this.fallFrame = fallFrame;
|
this.fallFrame = (int)params[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void setCollisionObject(CollisionObject body, Collidable collidable){
|
// public void setCollisionObject(CollisionObject body, Collidable collidable){
|
||||||
@ -197,16 +198,14 @@ public class ClientGravityTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientGravityTree attachTree(Entity parent, Collidable collidable, DBody body, int fallFrame){
|
public static ClientGravityTree attachTree(Entity parent, Object ... params){
|
||||||
ClientGravityTree rVal = new ClientGravityTree(parent, collidable, body, fallFrame);
|
ClientGravityTree rVal = new ClientGravityTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTGRAVITY, rVal);
|
parent.putData(EntityDataStrings.TREE_CLIENTGRAVITY, rVal);
|
||||||
Globals.clientScene.registerBehaviorTree(rVal);
|
Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal);
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTGRAVITY_ID);
|
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTGRAVITY_ID);
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,12 +50,13 @@ public class ServerGravityTree implements BehaviorTree {
|
|||||||
|
|
||||||
List<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
|
List<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
|
||||||
|
|
||||||
private ServerGravityTree(Entity e, Collidable collidable, DBody body, int fallFrame){
|
private ServerGravityTree(Entity e, Object ... params){
|
||||||
|
//Collidable collidable, DBody body, int fallFrame
|
||||||
state = GravityTreeState.ACTIVE;
|
state = GravityTreeState.ACTIVE;
|
||||||
parent = e;
|
parent = e;
|
||||||
this.body = body;
|
this.collidable = (Collidable)params[0];
|
||||||
this.collidable = collidable;
|
this.body = (DBody)params[1];
|
||||||
this.fallFrame = fallFrame;
|
this.fallFrame = (int)params[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void setCollisionObject(CollisionObject body, Collidable collidable){
|
// public void setCollisionObject(CollisionObject body, Collidable collidable){
|
||||||
@ -224,9 +225,10 @@ public class ServerGravityTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerGravityTree attachTree(Entity parent, Collidable collidable, DBody body, int fallFrame){
|
public static ServerGravityTree attachTree(Entity parent, Object ... params){
|
||||||
ServerGravityTree rVal = new ServerGravityTree(parent,collidable,body,fallFrame);
|
ServerGravityTree rVal = new ServerGravityTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public class ClientIdleTree implements BehaviorTree {
|
|||||||
* Creates an idle tree
|
* Creates an idle tree
|
||||||
* @param e the entity to attach the tree to
|
* @param e the entity to attach the tree to
|
||||||
*/
|
*/
|
||||||
public ClientIdleTree(Entity e){
|
public ClientIdleTree(Entity e, Object ... params){
|
||||||
state = IdleTreeState.IDLE;
|
state = IdleTreeState.IDLE;
|
||||||
parent = e;
|
parent = e;
|
||||||
//check if this is a creature, if so add its idle data
|
//check if this is a creature, if so add its idle data
|
||||||
@ -134,16 +134,14 @@ public class ClientIdleTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientIdleTree attachTree(Entity parent){
|
public static ClientIdleTree attachTree(Entity parent, Object ... params){
|
||||||
ClientIdleTree rVal = new ClientIdleTree(parent);
|
ClientIdleTree rVal = new ClientIdleTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_IDLE, rVal);
|
parent.putData(EntityDataStrings.TREE_IDLE, rVal);
|
||||||
Globals.clientScene.registerBehaviorTree(rVal);
|
Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal);
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_IDLE_ID);
|
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_IDLE_ID);
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,10 +46,10 @@ public class ServerIdleTree implements BehaviorTree {
|
|||||||
* Creates a server idle tree
|
* Creates a server idle tree
|
||||||
* @param e The entity to attach it to
|
* @param e The entity to attach it to
|
||||||
*/
|
*/
|
||||||
public ServerIdleTree(Entity e, IdleData idleData){
|
public ServerIdleTree(Entity e, Object ... params){
|
||||||
state = IdleTreeState.IDLE;
|
state = IdleTreeState.IDLE;
|
||||||
parent = e;
|
parent = e;
|
||||||
this.idleData = idleData;
|
this.idleData = (IdleData)params[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,9 +166,10 @@ public class ServerIdleTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerIdleTree attachTree(Entity parent, IdleData idleData){
|
public static ServerIdleTree attachTree(Entity parent, Object ... params){
|
||||||
ServerIdleTree rVal = new ServerIdleTree(parent, idleData);
|
ServerIdleTree rVal = new ServerIdleTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,12 +79,10 @@ public class ClientLifeTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientLifeTree attachTree(Entity parent, HealthSystem healthSystem){
|
public static ClientLifeTree attachTree(Entity parent, Object ... params){
|
||||||
ClientLifeTree rVal = new ClientLifeTree(parent,healthSystem);
|
ClientLifeTree rVal = new ClientLifeTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTLIFETREE, rVal);
|
parent.putData(EntityDataStrings.TREE_CLIENTLIFETREE, rVal);
|
||||||
@ -113,9 +111,9 @@ public class ClientLifeTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param parent The parent entity of this tree
|
* @param parent The parent entity of this tree
|
||||||
*/
|
*/
|
||||||
public ClientLifeTree(Entity parent, HealthSystem healthSystem){
|
public ClientLifeTree(Entity parent, Object ... params){
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.healthSystem = healthSystem;
|
this.healthSystem = (HealthSystem)params[0];
|
||||||
stateTransitionUtil = StateTransitionUtil.create(parent, false, new StateTransitionUtilItem[]{
|
stateTransitionUtil = StateTransitionUtil.create(parent, false, new StateTransitionUtilItem[]{
|
||||||
StateTransitionUtilItem.create(
|
StateTransitionUtilItem.create(
|
||||||
LifeStateEnum.DYING,
|
LifeStateEnum.DYING,
|
||||||
|
|||||||
@ -132,9 +132,10 @@ public class ServerLifeTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerLifeTree attachTree(Entity parent, HealthSystem healthSystem){
|
public static ServerLifeTree attachTree(Entity parent, Object ... params){
|
||||||
ServerLifeTree rVal = new ServerLifeTree(parent, healthSystem);
|
ServerLifeTree rVal = new ServerLifeTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
|
|
||||||
@ -166,13 +167,13 @@ public class ServerLifeTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param parent The parent entity of this tree
|
* @param parent The parent entity of this tree
|
||||||
*/
|
*/
|
||||||
public ServerLifeTree(Entity parent, HealthSystem healthSystem){
|
public ServerLifeTree(Entity parent, Object ... params){
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.lifeMax = healthSystem.getMaxHealth();
|
this.healthSystem = (HealthSystem)params[0];
|
||||||
|
this.lifeMax = this.healthSystem.getMaxHealth();
|
||||||
this.lifeCurrent = this.lifeMax;
|
this.lifeCurrent = this.lifeMax;
|
||||||
this.iFrameMaxCount = healthSystem.getOnDamageIFrames();
|
this.iFrameMaxCount = this.healthSystem.getOnDamageIFrames();
|
||||||
this.iFrameCurrent = 0;
|
this.iFrameCurrent = 0;
|
||||||
this.healthSystem = healthSystem;
|
|
||||||
stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{
|
stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{
|
||||||
StateTransitionUtilItem.create(
|
StateTransitionUtilItem.create(
|
||||||
LifeStateEnum.DYING,
|
LifeStateEnum.DYING,
|
||||||
|
|||||||
@ -110,9 +110,12 @@ public class ClientGroundMovementTree implements BehaviorTree {
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param e The parent entity
|
* @param e The parent entity
|
||||||
*/
|
*/
|
||||||
private ClientGroundMovementTree(Entity e){
|
private ClientGroundMovementTree(Entity e, Object ... params){
|
||||||
|
//Collidable collidable, GroundMovementSystem groundMovementData
|
||||||
state = MovementTreeState.IDLE;
|
state = MovementTreeState.IDLE;
|
||||||
parent = e;
|
parent = e;
|
||||||
|
this.collidable = (Collidable)params[0];
|
||||||
|
this.groundMovementData = (GroundMovementSystem)params[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -673,18 +676,14 @@ public class ClientGroundMovementTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientGroundMovementTree attachTree(Entity parent, Collidable collidable, GroundMovementSystem groundMovementData){
|
public static ClientGroundMovementTree attachTree(Entity parent, Object ... params){
|
||||||
ClientGroundMovementTree rVal = new ClientGroundMovementTree(parent);
|
ClientGroundMovementTree rVal = new ClientGroundMovementTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
rVal.collidable = collidable;
|
|
||||||
rVal.groundMovementData = groundMovementData;
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTGROUNDMOVEMENTTREE, rVal);
|
parent.putData(EntityDataStrings.TREE_CLIENTGROUNDMOVEMENTTREE, rVal);
|
||||||
Globals.clientScene.registerBehaviorTree(rVal);
|
Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal);
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID);
|
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID);
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,10 +77,12 @@ public class ServerGroundMovementTree implements BehaviorTree {
|
|||||||
Vector3d movementVector = new Vector3d(1,0,0);
|
Vector3d movementVector = new Vector3d(1,0,0);
|
||||||
|
|
||||||
|
|
||||||
private ServerGroundMovementTree(Entity e){
|
private ServerGroundMovementTree(Entity e, Object ... params){
|
||||||
|
//Collidable collidable
|
||||||
state = MovementTreeState.IDLE;
|
state = MovementTreeState.IDLE;
|
||||||
facing = MovementRelativeFacing.FORWARD;
|
facing = MovementRelativeFacing.FORWARD;
|
||||||
parent = e;
|
parent = e;
|
||||||
|
this.collidable = (Collidable)params[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public MovementTreeState getState(){
|
public MovementTreeState getState(){
|
||||||
@ -700,18 +702,17 @@ public class ServerGroundMovementTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerGroundMovementTree attachTree(Entity parent, Collidable collidable){
|
public static ServerGroundMovementTree attachTree(Entity parent, Object ... params){
|
||||||
ServerGroundMovementTree rVal = new ServerGroundMovementTree(parent);
|
ServerGroundMovementTree rVal = new ServerGroundMovementTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
rVal.collidable = collidable;
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
|
ServerBehaviorTreeUtils.attachBTreeToEntity(parent, rVal);
|
||||||
parent.putData(EntityDataStrings.TREE_SERVERGROUNDMOVEMENTTREE, rVal);
|
parent.putData(EntityDataStrings.TREE_SERVERGROUNDMOVEMENTTREE, rVal);
|
||||||
Globals.clientScene.registerBehaviorTree(rVal);
|
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID);
|
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID);
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,11 +56,11 @@ public class ClientJumpTree implements BehaviorTree {
|
|||||||
|
|
||||||
static final float jumpFalloff = 0.99f;
|
static final float jumpFalloff = 0.99f;
|
||||||
|
|
||||||
public ClientJumpTree(Entity parent, JumpMovementSystem jumpData){
|
public ClientJumpTree(Entity parent, Object ... params){
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.jumpFrames = jumpData.getJumpFrames();
|
this.jumpData = (JumpMovementSystem)params[0];
|
||||||
this.jumpForce = jumpData.getJumpForce();
|
this.jumpFrames = this.jumpData.getJumpFrames();
|
||||||
this.jumpData = jumpData;
|
this.jumpForce = this.jumpData.getJumpForce();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(){
|
public void start(){
|
||||||
@ -163,12 +163,10 @@ public class ClientJumpTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ClientJumpTree attachTree(Entity parent, JumpMovementSystem jumpData){
|
public static ClientJumpTree attachTree(Entity parent, Object ... params){
|
||||||
ClientJumpTree rVal = new ClientJumpTree(parent, jumpData);
|
ClientJumpTree rVal = new ClientJumpTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
|
||||||
|
|
||||||
|
|
||||||
//!!WARNING!! from here below should not be touched
|
//!!WARNING!! from here below should not be touched
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTJUMPTREE, rVal);
|
parent.putData(EntityDataStrings.TREE_CLIENTJUMPTREE, rVal);
|
||||||
|
|||||||
@ -48,11 +48,11 @@ public class ServerJumpTree implements BehaviorTree {
|
|||||||
|
|
||||||
static final float jumpFalloff = 0.99f;
|
static final float jumpFalloff = 0.99f;
|
||||||
|
|
||||||
public ServerJumpTree(Entity parent, JumpMovementSystem jumpData){
|
public ServerJumpTree(Entity parent, Object ... params){
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.jumpFrames = jumpData.getJumpFrames();
|
this.jumpData = (JumpMovementSystem)params[0];
|
||||||
this.jumpForce = jumpData.getJumpForce();
|
this.jumpFrames = this.jumpData.getJumpFrames();
|
||||||
this.jumpData = jumpData;
|
this.jumpForce = this.jumpData.getJumpForce();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(){
|
public void start(){
|
||||||
@ -157,9 +157,10 @@ public class ServerJumpTree implements BehaviorTree {
|
|||||||
* </p>
|
* </p>
|
||||||
* @param entity The entity to attach to
|
* @param entity The entity to attach to
|
||||||
* @param tree The behavior tree to attach
|
* @param tree The behavior tree to attach
|
||||||
|
* @param params Optional parameters that will be provided to the constructor
|
||||||
*/
|
*/
|
||||||
public static ServerJumpTree attachTree(Entity parent, JumpMovementSystem jumpData){
|
public static ServerJumpTree attachTree(Entity parent, Object ... params){
|
||||||
ServerJumpTree rVal = new ServerJumpTree(parent, jumpData);
|
ServerJumpTree rVal = new ServerJumpTree(parent,params);
|
||||||
//put manual code here (setting params, etc)
|
//put manual code here (setting params, etc)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user