File tree Expand file tree Collapse file tree 5 files changed +10
-11
lines changed Expand file tree Collapse file tree 5 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public interface Agent{
77}
88
99public interface Parametric {
10- Action [ ] Functions ( ) ;
10+ Complex [ ] Functions ( ) ;
1111}
1212
1313public interface Clonable < T > {
Original file line number Diff line number Diff line change 11using System ;
22
33namespace 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.
Original file line number Diff line number Diff 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 ) ) ;
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments