Skip to content

Feature/upgrade oyster to v2 #59

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

Merged
merged 2 commits into from
Jun 2, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false

[manifest.json]
indent_size = 2
11 changes: 11 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint Commit Messages
on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v3
19 changes: 19 additions & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Nightly Build
on:
push:
branches:
- develop
jobs:
deployNightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- run: npm run build
- name: Deploy nightly branch
run: sh ./publish-nightly.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- run: npm run build
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run semantic-release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ sysinfo.txt
*.apk
*.unitypackage
/Logs/Packages-Update.log
Logs/
CodeCoverage/

# Node.js
node_modules
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.9.1
14.16.0
22 changes: 22 additions & 0 deletions .oyster.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"description": "A micro-framework for creating Behavior Trees based upon the builder pattern",
"displayName": "Fluid Behavior Tree",
"keywords": [
"ai",
"behavior tree",
"builder pattern"
],
"oysterVersion": "2.1.0",
"packageName": "com.fluid.behavior-tree",
"packageScope": "com.fluid",
"unityVersion": "2018.1",
"author": {
"name": "Ash Blue",
"email": "[email protected]",
"url": "https://twitter.com/ashbluewd"
},
"repo": {
"gitUrl": "https://github.com/ashblue/fluid-behavior-tree",
"gitUrlNoHttp": "github.com/ashblue/fluid-behavior-tree"
}
}
26 changes: 16 additions & 10 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,36 @@
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/exec",
{
"verifyConditionsCmd": "npm run build",
"prepareCmd": "npm run build"
"publishCmd": "npm run build"
}
],
"@semantic-release/git",
[
"@semantic-release/npm",
{
"pkgRoot": "dist"
"pkgRoot": "Assets/com.fluid.behavior-tree"
}
],
[
"@semantic-release/github",
"@semantic-release/git",
{
"assets": [
{
"path": "dist.zip",
"label": "Package Build"
}
"CHANGELOG.md",
"package.json",
"package-lock.json",
"npm-shrinkwrap.json",
"Assets/**/*"
]
}
]
],
"@semantic-release/github"
]
}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions Assets/Resources.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/Resources/BillingMode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"androidStore":"GooglePlay"}
7 changes: 7 additions & 0 deletions Assets/Resources/BillingMode.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
using CleverCrow.Fluid.BTs.Tasks;
using Random = System.Random;
namespace CleverCrow.Fluid.BTs.TaskParents.Composites {
/// <summary>
/// Randomly selects a child node with a shuffle algorithm
/// </summary>
public class SelectorRandom : CompositeBase {
private bool _init;
public override string IconPath { get; } = $"{PACKAGE_ROOT}/LinearScale.png";
protected override TaskStatus OnUpdate () {
if (!_init) {
ShuffleChildren();
_init = true;
}
for (var i = ChildIndex; i < Children.Count; i++) {
var child = Children[ChildIndex];
switch (child.Update()) {
case TaskStatus.Success:
return TaskStatus.Success;
case TaskStatus.Continue:
return TaskStatus.Continue;
}
ChildIndex++;
}
return TaskStatus.Failure;
}
public override void Reset () {
base.Reset();
ShuffleChildren();
}
private void ShuffleChildren () {
var rng = new Random();
var n = Children.Count;
while (n > 1) {
n--;
var k = rng.Next(n + 1);
var value = Children[k];
Children[k] = Children[n];
Children[n] = value;
}
}
}
using CleverCrow.Fluid.BTs.Tasks;
using Random = System.Random;

namespace CleverCrow.Fluid.BTs.TaskParents.Composites {
/// <summary>
/// Randomly selects a child node with a shuffle algorithm
/// </summary>
public class SelectorRandom : CompositeBase {
private bool _init;

public override string IconPath { get; } = $"{PACKAGE_ROOT}/LinearScale.png";

protected override TaskStatus OnUpdate () {
if (!_init) {
ShuffleChildren();
_init = true;
}

for (var i = ChildIndex; i < Children.Count; i++) {
var child = Children[ChildIndex];

switch (child.Update()) {
case TaskStatus.Success:
return TaskStatus.Success;
case TaskStatus.Continue:
return TaskStatus.Continue;
}

ChildIndex++;
}

return TaskStatus.Failure;
}

public override void Reset () {
base.Reset();

ShuffleChildren();
}

private void ShuffleChildren () {
var rng = new Random();
var n = Children.Count;
while (n > 1) {
n--;
var k = rng.Next(n + 1);
var value = Children[k];
Children[k] = Children[n];
Children[n] = value;
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading