2020-05-04 00:07:36 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections;
|
2020-04-23 03:31:17 +01:00
|
|
|
|
using System.Collections.Generic;
|
2020-05-06 04:56:36 +01:00
|
|
|
|
using JsonKnownTypes;
|
|
|
|
|
|
using MessagePack;
|
|
|
|
|
|
using Newtonsoft.Json;
|
2020-04-23 03:31:17 +01:00
|
|
|
|
|
2020-05-06 04:56:36 +01:00
|
|
|
|
[MessagePackObject,
|
|
|
|
|
|
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<Entity>))]
|
2020-04-23 03:31:17 +01:00
|
|
|
|
public class EntityAgent
|
|
|
|
|
|
{
|
2020-05-06 04:56:36 +01:00
|
|
|
|
[IgnoreMember] public AgentBehavior CurrentBehavior;
|
|
|
|
|
|
[IgnoreMember] public Guid Entity;
|
|
|
|
|
|
[IgnoreMember] public GameContext Context;
|
|
|
|
|
|
[JsonProperty("homeZone"), Key(0)] public Guid HomeZone;
|
|
|
|
|
|
[JsonProperty("homeColony"), Key(0)] public Guid HomeColony;
|
2020-04-23 03:31:17 +01:00
|
|
|
|
|
2020-05-06 04:56:36 +01:00
|
|
|
|
public EntityAgent(GameContext context, Guid entity, Guid homeZone, Guid homeColony)
|
2020-04-23 03:31:17 +01:00
|
|
|
|
{
|
|
|
|
|
|
Entity = entity;
|
2020-05-06 04:56:36 +01:00
|
|
|
|
HomeZone = homeZone;
|
2020-04-23 03:31:17 +01:00
|
|
|
|
Context = context;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Update(float delta)
|
|
|
|
|
|
{
|
2020-05-06 04:56:36 +01:00
|
|
|
|
CurrentBehavior?.Update(delta);
|
2020-04-23 03:31:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|