public void RemoveMonster(MonsterAwake monsterAdd) { int i = 0; foreach (MonsterAwake monster in ListBestiary) { if (monsterAdd.CompareTo(monster) == 0) { ListBestiary.RemoveAt(i); return; } i++; } }
/// <summary> /// Add an awake monster to the bestiary /// </summary> /// <param name="monsterAdd"></param> public bool AddMonster(MonsterAwake monsterAdd) { int i = 0; foreach (MonsterAwake monster in ListBestiary) { if (monsterAdd.CompareTo(monster) == 0) { return(false); } if (monsterAdd.CompareTo(monster) <= 0) { ListBestiary.Insert(i, monsterAdd); return(true); } i++; } ListBestiary.Add(monsterAdd); return(true); }