Beispiel #1
0
 public void RimuoviPersonaggio(Personaggio a)
 {
     foreach (Personaggio b in Personaggi)
     {
         if (b.Nome == a.Nome)
         {
             Personaggi.Remove(b);
             return;
         }
     }
     throw new Exception("Razza non esistente");
 }
Beispiel #2
0
        public void AggiungiPersonaggio(Personaggio a)
        {
            foreach (Personaggio b in Personaggi)
            {
                if (b.Nome == a.Nome)
                {
                    throw new Exception("Personaggio già esistente");
                }
            }

            Personaggi.Add(a);
        }
Beispiel #3
0
 private void RemovePersonaggio(string item) { Personaggi.Remove(item); }
Beispiel #4
0
 private void AddPersonaggio(string item) { Personaggi.Add(item); }