//Adds stats of the new Entity to the Lists public void AddEntity(int[] stats, string[] traits) { ID.Add(next_ID); Alive.Add(next_ID); Str.Add(stats[0]); Agi.Add(stats[1]); Int.Add(stats[2]); //Behaviour.Add(traits); Behaviour.Add(traits); ////selects the corresponding Behaviour switch (traits[1]) { case "Friendly": Friendlies.Add(next_ID); break; case "Hostile": Hostiles.Add(next_ID); break; case "Neutral": Neutrals.Add(next_ID); break; default: Console.WriteLine("Error, assuming Neutral"); Neutrals.Add(next_ID); break; } switch (traits[2]) { case "Melee": AttackDamage.Add(stats[0] + stats[1]); break; case "Ranged": AttackDamage.Add(stats[1] + stats[2]); break; } next_ID++; }
//Kills an Entity, moving it to the Dead list and removing from it's Alignment list public void KillEntity(int in_ID) { int index = ID.IndexOf(in_ID); switch (Behaviour[index][1]) { case "Friendly": Friendlies.RemoveAt(Friendlies.IndexOf(in_ID)); break; case "Hostile": Hostiles.RemoveAt(Hostiles.IndexOf(in_ID)); break; case "Neutral": Neutrals.RemoveAt(Neutrals.IndexOf(in_ID)); break; } Alive.Remove(in_ID); Dead.Add(in_ID); }