public void AddSurvivor(Survivor survivor) { if (SurvivorAlreadyExists(survivor)) { return; } Survivors.Add(survivor); survivor.SurvivorDied += HandleSurvivorDied; survivor.SurvivorLeveledUp += HandleGameLevelUpEvent; survivor.SurvivorAcquiredEquipment += HandleSurvivorAcquiredEquipment; survivor.SurvivorWounded += HandleSurvivorWounded; AddHistoryEvent(EventType.SurvivorAdded); }
private bool SurvivorAlreadyExists(Survivor survivor) { return(Survivors.Count(x => x.Name == survivor.Name) > 0); }