riversong code showcase
This commit is contained in:
65
Source/Riversong/Game/World/Agents/Agent.cs
Normal file
65
Source/Riversong/Game/World/Agents/Agent.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using Unity.Mathematics;
|
||||
|
||||
namespace DanieleMarotta.RiversongCodeShowcase
|
||||
{
|
||||
public class Agent : Entity, IDisposable
|
||||
{
|
||||
private IntentQueue _intentQueue;
|
||||
|
||||
private TilePath _path;
|
||||
|
||||
private AgentJobState _agentJobState;
|
||||
|
||||
private CritterState _critterState;
|
||||
|
||||
public int CarriedProductHandle;
|
||||
|
||||
public AgentDefinition Definition { get; set; }
|
||||
|
||||
public int HomeId { get; set; }
|
||||
|
||||
public float3 Position { get; set; }
|
||||
|
||||
public float3 Heading { get; set; }
|
||||
|
||||
public float3 Velocity { get; set; }
|
||||
|
||||
public AgentLifecycleState LifecycleState { get; set; } = AgentLifecycleState.New;
|
||||
|
||||
public IntentExecutionState IntentExecutionState { get; set; } = IntentExecutionState.WaitingIntent;
|
||||
|
||||
public float IntentExecutionTime { get; set; }
|
||||
|
||||
public int PathQueryHandle { get; set; }
|
||||
|
||||
public int PathIndex { get; set; }
|
||||
|
||||
public int2 WanderingCenter { get; set; }
|
||||
|
||||
public ref IntentQueue GetIntentQueueRW()
|
||||
{
|
||||
return ref _intentQueue;
|
||||
}
|
||||
|
||||
public ref TilePath GetPathRW()
|
||||
{
|
||||
return ref _path;
|
||||
}
|
||||
|
||||
public ref AgentJobState GetJobStateRW()
|
||||
{
|
||||
return ref _agentJobState;
|
||||
}
|
||||
|
||||
public ref CritterState GetCritterStateRW()
|
||||
{
|
||||
return ref _critterState;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_path.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user