Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crashkonijn committed Sep 18, 2024
1 parent 62e29d8 commit 57dffde
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 24 deletions.
2 changes: 0 additions & 2 deletions Demo/Assets/Docs/GettingStarted/Sensors/IdleTargetSensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ public class IdleTargetSensor : LocalTargetSensorBase
// Is called when this script is initialzed
public override void Created()
{

}

// Is called every frame that an agent of an `AgentType` that uses this sensor needs it.
// This can be used to 'cache' data that is used in the `Sense` method.
// Eg look up all the trees in the scene, and then find the closest one in the Sense method.
public override void Update()
{

}

public override ITarget Sense(IActionReceiver agent, IComponentReference references, ITarget existingTarget)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,5 @@ public override VisualElement CreateInspectorGUI()

return root;
}

}
}
10 changes: 0 additions & 10 deletions Package/Runtime/CrashKonijn.Agent.Runtime/ActionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

namespace CrashKonijn.Agent.Runtime
{
// Backwards compatibility for old actions
public abstract class AgentActionBase<TActionData> : AgentActionBase<TActionData, EmptyActionProperties>
where TActionData : IActionData, new()
{
}

public class EmptyActionProperties : IActionProperties
{
}

public abstract class AgentActionBase<TActionData, TActionProperties>
where TActionData : IActionData, new()
where TActionProperties : class, IActionProperties, new()
Expand Down
10 changes: 10 additions & 0 deletions Package/Runtime/CrashKonijn.Agent.Runtime/AgentActionBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using CrashKonijn.Agent.Core;

namespace CrashKonijn.Agent.Runtime
{
// Backwards compatibility for old actions
public abstract class AgentActionBase<TActionData> : AgentActionBase<TActionData, EmptyActionProperties>
where TActionData : IActionData, new()
{
}
}
11 changes: 11 additions & 0 deletions Package/Runtime/CrashKonijn.Agent.Runtime/AgentActionBase.cs.meta

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
@@ -0,0 +1,8 @@
using CrashKonijn.Agent.Core;

namespace CrashKonijn.Agent.Runtime
{
public class EmptyActionProperties : IActionProperties
{
}
}

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

18 changes: 18 additions & 0 deletions Package/Runtime/CrashKonijn.Goap.Runtime/Behaviours/ActionBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using CrashKonijn.Agent.Core;
using CrashKonijn.Agent.Runtime;

namespace CrashKonijn.Goap.Runtime
{
[Obsolete("Use GoapActionBase instead of ActionBase")]
public abstract class ActionBase<TActionData> : GoapActionBase<TActionData, EmptyActionProperties>
where TActionData : IActionData, new()
{
public override IActionRunState Perform(IMonoAgent agent, TActionData data, IActionContext context)
{
return this.Perform(agent, data, context as ActionContext);
}

public abstract ActionRunState Perform(IMonoAgent agent, TActionData data, ActionContext context);
}
}

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
Expand Up @@ -6,18 +6,7 @@
namespace CrashKonijn.Goap.Runtime
{
// Backwards compatability for v2 actions
[Obsolete("Use GoapActionBase instead of ActionBase")]
public abstract class ActionBase<TActionData> : GoapActionBase<TActionData, EmptyActionProperties>
where TActionData : IActionData, new()
{
public override IActionRunState Perform(IMonoAgent agent, TActionData data, IActionContext context)
{
return this.Perform(agent, data, context as ActionContext);
}

public abstract ActionRunState Perform(IMonoAgent agent, TActionData data, ActionContext context);
}

public abstract class GoapActionBase<TActionData> : GoapActionBase<TActionData, EmptyActionProperties>
where TActionData : IActionData, new()
{
Expand Down

0 comments on commit 57dffde

Please sign in to comment.