예제 #1
0
        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);
        }
예제 #2
0
 private bool SurvivorAlreadyExists(Survivor survivor)
 {
     return(Survivors.Count(x => x.Name == survivor.Name) > 0);
 }