Move behavior grouping onto runtime instances
This commit is contained in:
parent
a639569f72
commit
eabe0961e6
5 changed files with 13 additions and 9 deletions
|
|
@ -14,6 +14,7 @@ public abstract class Behavior
|
|||
{
|
||||
public BehaviorData Data { get; }
|
||||
public string Kind { get; }
|
||||
public int Group { get; }
|
||||
public EquippedItem Item { get; }
|
||||
private ConsumableItemEffect Consumable { get; }
|
||||
protected ItemManager ItemManager { get; }
|
||||
|
|
@ -47,6 +48,7 @@ public abstract class Behavior
|
|||
{
|
||||
Data = data;
|
||||
Kind = data?.Kind ?? "";
|
||||
Group = data?.Group ?? 0;
|
||||
Item = item;
|
||||
ItemManager = Item.ItemManager;
|
||||
}
|
||||
|
|
@ -55,6 +57,7 @@ public abstract class Behavior
|
|||
{
|
||||
Data = data;
|
||||
Kind = data?.Kind ?? "";
|
||||
Group = data?.Group ?? 0;
|
||||
Consumable = consumable;
|
||||
ItemManager = consumable.Entity.ItemManager;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1395,7 +1395,7 @@ public class EquippedItem
|
|||
Behaviors = ItemManager.CreateRuntimeBehaviors(this);
|
||||
|
||||
BehaviorGroups = Behaviors
|
||||
.GroupBy(b => b.Data.Group)
|
||||
.GroupBy(b => b.Group)
|
||||
.OrderBy(g => g.Key)
|
||||
.ToDictionary(g => g.Key, g => new BehaviorGroup
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue