Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collective behavior trees #3708

Merged
merged 4 commits into from Jul 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -44,6 +44,7 @@ engine-tests/engine-tests.iml
/*.ipr
/*.iws
/projectFilesBackup*
/**/*.iml

# Ignore Eclipse
.checkstyle
Expand Down
@@ -0,0 +1,3 @@
{
print:{msg:A}
}
@@ -0,0 +1,3 @@
{
print:{msg:B}
}
@@ -0,0 +1,5 @@
{
lookup : {
tree: ""
}
}
@@ -0,0 +1,3 @@
{
lookup : { tree : "unittest:BehaviorA" }
}
@@ -0,0 +1,10 @@
{
sequence : [
{
lookup : { tree : "unittest:BehaviorA" }
},
{
lookup : { tree : "unittest:BehaviorB" }
}
]
}
@@ -0,0 +1,3 @@
{
"parent" : "unittest:withComponent"
}
@@ -0,0 +1,3 @@
{
"parent" : "unittest:inheritsComponent"
}
@@ -0,0 +1,2 @@
{
}
@@ -0,0 +1,9 @@
{
"MappedContainer": {
"containers": [
{
"value": "a"
}
]
}
}
@@ -0,0 +1,3 @@
{
"String" : {}
}
@@ -0,0 +1,10 @@
{
"OrderedMapTest" = {
"orderedMap" = {
"one" : 1,
"two" : 2,
"three" : 3,
"four" : 4
}
}
}
@@ -0,0 +1,15 @@
{
"ListOfObject" : {
"shortName" : "Test",
"elements" : [
{
"id" : "goSomewhere",
"type" : "myType1"
},
{
"id" : "returnHome",
"type" : "myType2"
}
]
}
}
@@ -0,0 +1,5 @@
{
"ListOfEnums":{
"elements":["TOP","LEFT","RIGHT","FRONT","BACK","BOTTOM"]
}
}
6 changes: 6 additions & 0 deletions engine-tests/out/production/resources/module.txt
@@ -0,0 +1,6 @@
{
"id" : "unittest",
"version" : "2.2.1-SNAPSHOT",
"displayName" : "Terasology Engine Test",
"description" : "Engine unit test content"
}
25 changes: 25 additions & 0 deletions engine-tests/out/test/resources/contextMenuBuilderInput.ui
@@ -0,0 +1,25 @@
{
"type": "PlaceholderScreen",
"contents": {
"type": "relativeLayout",
"contents": [
{
"type": "UIButton",
"layoutInfo": {
"position-horizontal-center": {},
"position-top": {}
}
},
{
"type": "RowLayout",
"layoutInfo": {},
"contents": [
{
"type": "UILabel",
"layoutInfo": {}
}
]
}
]
}
}
17 changes: 17 additions & 0 deletions engine-tests/out/test/resources/gameManifest.json
@@ -0,0 +1,17 @@
{
"title": "Game 1",
"seed": "naqrhaKV1lUofG7PLIJcOfDlUiPs3Jmp",
"time": 37047,
"registeredBlockFamilies": [],
"blockIdMap": {},
"biomeIdMap": {},
"worlds": {
"main": {
"title": "main",
"seed": "naqrhaKV1lUofG7PLIJcOfDlUiPs3Jmp",
"time": 25538256,
"worldGenerator": "Core:heightMap"
}
},
"modules": []
}
182 changes: 182 additions & 0 deletions engine-tests/out/test/resources/jsonTreeConverterInput.json
@@ -0,0 +1,182 @@
[
{
"name": "May Huffman",
"age": 27,
"isActive": false,
"latitude": -61.958578,
"longitude": -49.950219,
"tags": [
"reprehenderit",
"nulla",
"duis",
"incididunt",
"quis",
"proident",
"sit"
],
"friends": [
{
"id": 0,
"name": "Justice Beach"
},
{
"id": 1,
"name": "Kim Luna"
},
{
"id": 2,
"name": "Melinda Kemp"
}
]
},
{
"name": "Alma Wood",
"age": 26,
"isActive": true,
"latitude": 22.877632,
"longitude": -113.968629,
"tags": [
"pariatur",
"id",
"nulla",
"id",
"enim",
"id",
"incididunt"
],
"friends": [
{
"id": 0,
"name": "Wheeler Galloway"
},
{
"id": 1,
"name": "Manning Campos"
},
{
"id": 2,
"name": "Nash Gilliam"
}
]
},
{
"name": "Reyna Clemons",
"age": 37,
"isActive": true,
"latitude": -33.209027,
"longitude": -40.904843,
"tags": [
"sit",
"id",
"commodo",
"ipsum",
"culpa",
"elit",
"amet"
],
"friends": [
{
"id": 0,
"name": "Carpenter Valenzuela"
},
{
"id": 1,
"name": "Morrison Higgins"
},
{
"id": 2,
"name": "Copeland Garrison"
}
]
},
{
"name": "Pugh Riggs",
"age": 20,
"isActive": false,
"latitude": -22.358309,
"longitude": -55.981277,
"tags": [
"labore",
"pariatur",
"ut",
"ullamco",
"irure",
"nisi",
"est"
],
"friends": [
{
"id": 0,
"name": "Watkins Rush"
},
{
"id": 1,
"name": "Preston Booker"
},
{
"id": 2,
"name": "Payne Case"
}
]
},
{
"name": "Mooney Robinson",
"age": 33,
"isActive": true,
"latitude": 57.099089,
"longitude": -33.034853,
"tags": [
"sunt",
"fugiat",
"eiusmod",
"non",
"id",
"est",
"incididunt"
],
"friends": [
{
"id": 0,
"name": "Elaine Price"
},
{
"id": 1,
"name": "Solomon Alvarez"
},
{
"id": 2,
"name": "Valarie Charles"
}
]
},
{
"name": "Byers Travis",
"age": 23,
"isActive": false,
"latitude": -67.722482,
"longitude": -9.53719,
"tags": [
"pariatur",
"quis",
"sunt",
"amet",
"velit",
"dolore",
"cupidatat"
],
"friends": [
{
"id": 0,
"name": "Deloris Perez"
},
{
"id": 1,
"name": "Pauline Estrada"
},
{
"id": 2,
"name": "Savannah Whitaker"
}
]
}
]
20 changes: 20 additions & 0 deletions engine-tests/out/test/resources/logback.xml
@@ -0,0 +1,20 @@
<configuration>

<!-- Report all changes to this configuration on System.out -->
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="${logOverrideLevel:-debug}">
<appender-ref ref="CONSOLE" />
</root>

<logger name="org.terasology" level="${logOverrideLevel:-info}" />
<logger name="org.reflections.Reflections" level="${logOverrideLevel:-warn}" />

</configuration>
23 changes: 23 additions & 0 deletions engine/src/main/java/org/terasology/logic/behavior/Callback.java
@@ -0,0 +1,23 @@
/*
* Copyright 2019 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.terasology.logic.behavior;

import org.terasology.logic.behavior.core.BehaviorNode;
import org.terasology.logic.behavior.core.BehaviorState;

public interface Callback {
void afterExecute(BehaviorNode node, BehaviorState state);
}