Beispiel #1
0
    void GenerateTestAffixContainer()
    {
        AffixContainer container = new AffixContainer();
        Affix          health1   = AffixInfo.GetAffixInfo(AffixType.Health).GenerateAffix(2);

        container.Add(health1);
        container.Add(AffixInfo.GetAffixInfo(AffixType.Health).GenerateAffix(2));
        container.Add(health1);
        container.Add(AffixInfo.GetAffixInfo(AffixType.PhysDmgFlat).GenerateAffix(3));

        print(container);

        container.Remove(health1);

        print(container);

        Affix fireRate = AffixInfo.GetAffixInfo(AffixType.FireRate).GenerateAffix(5);

        container.Remove(fireRate);

        Affix health2 = AffixInfo.GetAffixInfo(AffixType.Health).GenerateAffix(3);

        container.Remove(health2);
    }
Beispiel #2
0
 /// <summary>
 /// Propagates a single affix upwards through the hierarchy.
 /// </summary>
 /// <param name="affix">The affix to be propagated</param>
 protected void Propagate(Affix affix)
 {
     parent?.Add(affix);
 }