Skip to content

Commit 02f8764

Browse files
committed
Rename Action to Complex
1 parent 4ecac72 commit 02f8764

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

Runtime/Agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public interface Agent{
77
}
88

99
public interface Parametric{
10-
Action[] Functions();
10+
Complex[] Functions();
1111
}
1212

1313
public interface Clonable<T>{

Runtime/Action.cs renamed to Runtime/Complex.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System;
22

33
namespace Activ.GOAP{
4-
public readonly struct Action{
4+
public readonly struct Complex{
55

66
public readonly Func<Cost> action;
77
public readonly System.Action effect;
88

9-
public Action(Func<Cost> method, System.Action effect){
9+
public Complex(Func<Cost> method, System.Action effect){
1010
this.action = method;
1111
this.effect = effect;
1212
}
File renamed without changes.

Tests/Models/Baker.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ public Cost SetTemperature(int degrees){
3232
Func<Cost>[] Agent.Actions()
3333
=> state != Cooking.Burned ? new Func<Cost>[]{ Bake } : null;
3434

35-
Action[] Parametric.Functions()
35+
Complex[] Parametric.Functions()
3636
=> state != Cooking.Burned ? CookingOptions() : null;
3737

38-
Action[] CookingOptions(){
39-
List<Action> elems = new List<Action>();
38+
// TODO - very slow. Doesn't matter
39+
Complex[] CookingOptions(){
40+
List<Complex> elems = new List<Complex>();
4041
for(int i = 0; i <= MaxHeat; i += Step){
4142
var j = i; // Do not capture the iterator!
42-
elems.Add(new Action(
43+
elems.Add(new Complex(
4344
() => SetTemperature(j),
4445
() => client.SetTemperature(j)
4546
));

Tests/Models/Freeloader.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ namespace Activ.GOAP{
66

77
public Cost Load(int n) => 0;
88

9-
//Func<Cost>[] Agent.Actions() => new Func<Cost>[]{ };
10-
11-
Action[] Parametric.Functions() => new Action[]{
12-
new Action( () => Load(1000), () => {} )
9+
Complex[] Parametric.Functions() => new Complex[]{
10+
new Complex( () => Load(1000), () => {} )
1311
};
1412

1513
override public bool Equals(object that)

0 commit comments

Comments
 (0)