Behavior Canceling & Grouping
Behaviors are now grouped, behaviors within a group can cancel execution of the rest of the group
This commit is contained in:
parent
c24c155673
commit
fc94531566
35 changed files with 613 additions and 190 deletions
54
Assets/Scripts/ServerShared/Behaviors/ActivatedItemUsage.cs
Normal file
54
Assets/Scripts/ServerShared/Behaviors/ActivatedItemUsage.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
[InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class ActivatedItemUsageData : BehaviorData
|
||||
{
|
||||
|
||||
public override IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
|
||||
{
|
||||
return new ActivatedItemUsage(context, this, entity, item);
|
||||
}
|
||||
}
|
||||
|
||||
public class ActivatedItemUsage : IActivatedBehavior
|
||||
{
|
||||
private ActivatedItemUsageData _data;
|
||||
|
||||
private Entity Entity { get; }
|
||||
private Gear Item { get; }
|
||||
private GameContext Context { get; }
|
||||
|
||||
public BehaviorData Data => _data;
|
||||
|
||||
public ActivatedItemUsage(GameContext context, ActivatedItemUsageData data, Entity entity, Gear item)
|
||||
{
|
||||
_data = data;
|
||||
Entity = entity;
|
||||
Item = item;
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
}
|
||||
|
||||
public bool Activate()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public bool Update(float delta)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue