You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
815 B
32 lines
815 B
using System;
|
|
using System.Collections.Generic;
|
|
|
|
[Serializable]
|
|
public class SynergyProperty<T>
|
|
{
|
|
public T[] condition;
|
|
public int shouldMatchCount;
|
|
public BuffProperty[] buffs;
|
|
}
|
|
|
|
public class SynergyData<T> : IHasBuff
|
|
{
|
|
BuffData[] buffs;
|
|
|
|
public Condition<T> Condition { get; private set; }
|
|
public IReadOnlyList<BuffData> Buffs => buffs;
|
|
|
|
public SynergyData(SynergyProperty<T> property)
|
|
{
|
|
Condition = new Condition<T>(property.condition, property.shouldMatchCount);
|
|
|
|
buffs = new BuffData[property.buffs.Length];
|
|
for (int i = 0; i < property.buffs.Length; i++)
|
|
{
|
|
buffs[i] = new BuffData(property.buffs[i], this);
|
|
}
|
|
}
|
|
|
|
public bool CheckCondition(IReadOnlyList<T> currentState) => Condition.CheckCondition(currentState);
|
|
}
|
|
|