40 lines
1.6 KiB
C#
40 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Continentis.MainGame.Equipment
|
|
{
|
|
public class AttributeSubmodule : SubmoduleBase<EquipmentBase>
|
|
{
|
|
public Dictionary<string, float> numericChange;
|
|
public Dictionary<string, float> percentageChangeOfAccumulation;
|
|
public Dictionary<string, float> percentageChangeOfMultiplication;
|
|
|
|
public AttributeSubmodule(EquipmentBase equipment,
|
|
Dictionary<string, float> numericChange,
|
|
Dictionary<string, float> percentageChangeOfAccumulation,
|
|
Dictionary<string, float> percentageChangeOfMultiplication) : base(equipment)
|
|
{
|
|
this.numericChange = numericChange ?? new Dictionary<string, float>();
|
|
this.percentageChangeOfAccumulation = percentageChangeOfAccumulation ?? new Dictionary<string, float>();
|
|
this.percentageChangeOfMultiplication = percentageChangeOfMultiplication ?? new Dictionary<string, float>();
|
|
}
|
|
|
|
public List<string> GetModifiedAttributeNames()
|
|
{
|
|
HashSet<string> attributeNames = new HashSet<string>();
|
|
foreach (var key in numericChange.Keys)
|
|
{
|
|
attributeNames.Add(key);
|
|
}
|
|
foreach (var key in percentageChangeOfAccumulation.Keys)
|
|
{
|
|
attributeNames.Add(key);
|
|
}
|
|
foreach (var key in percentageChangeOfMultiplication.Keys)
|
|
{
|
|
attributeNames.Add(key);
|
|
}
|
|
return new List<string>(attributeNames);
|
|
}
|
|
}
|
|
} |