public override void ToggleSoul(SoulType soul) { var maxPowerSoulCount = SoulCollection.PowerSoulsCount; if (maxPowerSoulCount == 0) { return; } if (ActiveSouls.Contains(soul)) { RemoveSoul(soul); } else if (ActiveSouls.Count < maxPowerSoulCount) { AddSoul(soul); } else { RemoveFirst(); AddSoul(soul); } OnPropertyChanged(nameof(PowerSoulsCount)); OnPropertyChanged(nameof(TotalUniques)); LoadoutSouls.RefreshPropertyBinding("PowerSoul1"); LoadoutSouls.RefreshPropertyBinding("PowerSoul2"); HasChanges = true; }
void RemoveSoul(SoulType soulType) { ActiveSouls.Remove(soulType); var soul = Soul.New(soulType, LoadoutSouls); soul.DeactivateUniqueEffect(); LoadoutSouls.DeregisterChild(soul); }
private void AddSoul(SoulType soulType) { ActiveSouls.Add(soulType); var soul = Soul.New(soulType, LoadoutSouls); soul.ActivateUniqueEffect(); LoadoutSouls.DeregisterChild(soul); }
public override void OnLoaded() { foreach (var soulType in ActiveSouls) { var soul = Soul.New(soulType, LoadoutSouls); soul.ActivateUniqueEffect(); LoadoutSouls.DeregisterChild(soul); } base.OnLoaded(); }