Skip to content

Commit 5e76441

Browse files
author
Bytekeeper
committed
Small improvements mostly, added Wait node which will just run endlessly.
1 parent 271ca96 commit 5e76441

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

src/main/java/org/bk/ass/bt/TreeNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void abort() {
5050
status = NodeStatus.ABORTED;
5151
}
5252

53-
public TreeNode withName(String name) {
53+
public final TreeNode withName(String name) {
5454
this.name = name;
5555
return this;
5656
}

src/main/java/org/bk/ass/bt/Wait.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.bk.ass.bt;
2+
3+
public class Wait extends TreeNode {
4+
5+
public static final Wait INSTANCE = new Wait();
6+
7+
protected Wait() {
8+
9+
}
10+
11+
@Override
12+
public void init() {
13+
running();
14+
}
15+
16+
@Override
17+
public void exec() {
18+
// Nothing to do
19+
}
20+
}

src/main/java/org/bk/ass/collection/FastArrayFill.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public static void fillArray(byte[] array, byte value) {
1717
}
1818
}
1919

20-
public static void fillArray(Object[] array, int fromIndex, int toIndex, Object value) {
21-
int len = toIndex - fromIndex;
20+
public static void fillArray(Object[] array, int fromIndex, int endIndex, Object value) {
21+
int len = endIndex - fromIndex;
2222
array[fromIndex] = value;
2323
for (int i = 1; i < len; i += i) {
2424
System.arraycopy(array, fromIndex, array, fromIndex + i, Math.min(len - i, i));

src/main/java/org/bk/ass/sim/Agent.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public class Agent {
8585
// Lockdown or no damage and no movement
8686

8787
UnitSize size;
88-
8988
boolean isMelee;
9089
Weapon airWeapon;
9190
Weapon groundWeapon;
@@ -453,6 +452,10 @@ public void setAttackTarget(Agent attackTarget) {
453452
this.attackTarget = attackTarget;
454453
}
455454

455+
public void setRestoreTarget(Agent restoreTarget) {
456+
this.restoreTarget = restoreTarget;
457+
}
458+
456459
/** Set this carriers interceptors. These will be killed as well, if the carrier dies. */
457460
public void setInterceptors(Collection<Agent> childAgents) {
458461
this.interceptors = new ArrayList<>(childAgents);

0 commit comments

Comments
 (0)