Skip to content

Commit c18ce14

Browse files
author
Bytekeeper
committed
Javadoc fixes and test improvement.
1 parent 1eb3de7 commit c18ce14

File tree

6 files changed

+52
-20
lines changed

6 files changed

+52
-20
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* A behavior tree. Main difference to other compound nodes is that the actual root tree node is
77
* constructed on initialization.
8-
* <p/>
8+
* <p>
99
* This allows data oriented programming, with simplified access to some data:
1010
* <pre>
1111
* {@code

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* This is like <code>map</code> for streams. Maps each item of a given list to a node. New nodes
1919
* will only be created for new items. Nodes for items that are no longer present will be aborted
2020
* and discarded.
21-
* <p/>
21+
* <p>
2222
* The created child nodes will be executed in parallel in the order of the item list.
2323
*
2424
* @param <T> the type of the item used to create new nodes

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.bk.ass.bt;
22

33
/**
4-
* Delegates execution but returns the inverted status (ie. failed -> success; success -> failed;
5-
* running -> running).
4+
* Delegates execution but returns the inverted status (ie. failed &rarr; success; success &rarr; failed;
5+
* running &rarr; running).
66
*/
77
public class Inverter extends Decorator {
88

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
/**
66
* Repeatedly ticks a delegate node. If the delegate completes its operation, it will automatically
77
* be resetted and re-ticked.
8-
* <p/>
8+
* <p>
99
* An internal {@link Policy} is used to determine the status of the Repeat node based on the result
1010
* of the delegate.
11-
* <p/>
11+
* <p>
1212
* Use {@link Policy#SEQUENCE} to tick a delegate as long as it is succeeding. Use {@link
1313
* Policy#SELECTOR} to tick a delegate until it succeeds. Use {@link Policy#SELECTOR_INVERTED} to
1414
* tick a delegate until it fails.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package org.bk.ass.grid;
2+
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
class BooleanGridTest {
8+
9+
@Test
10+
void shouldDiscardValueOnVersionUpdate() {
11+
// GIVEN
12+
BooleanGrid sut = new BooleanGrid(10, 10);
13+
sut.set(1, 1, true);
14+
15+
// WHEN
16+
sut.updateVersion();
17+
18+
// THEN
19+
assertThat(sut.get(1, 1)).isFalse();
20+
}
21+
22+
@Test
23+
void shouldSetValue() {
24+
// GIVEN
25+
BooleanGrid sut = new BooleanGrid(10, 10);
26+
27+
// WHEN
28+
sut.set(1, 1, true);
29+
30+
// THEN
31+
assertThat(sut.get(1, 1)).isTrue();
32+
}
33+
34+
@Test
35+
void shouldUnsetValue() {
36+
// GIVEN
37+
BooleanGrid sut = new BooleanGrid(10, 10);
38+
sut.set(1, 1, true);
39+
40+
// WHEN
41+
sut.set(1, 1, false);
42+
43+
// THEN
44+
assertThat(sut.get(1, 1)).isFalse();
45+
}
46+
}

src/test/java/org/bk/ass/grid/VersionedGridTest.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)