//Updates Tiles and all NPCs on them protected void UpdateNPCs(GameTime gameTime) { List <NPC> toRemove = new List <NPC>(); foreach (NPC n in NPCs) { n.Update(gameTime); //Reset any entity which falls down from the map if (CheckOutOfMap((int)n.Position.Y) == -1 && n.Alive) { n.Reset(); } if (!n.Alive) { toRemove.Add(n); } } //Removes dead NPCs foreach (NPC n in toRemove) { if (NPCs.Contains(n)) { NPCs.Remove(n); } } }
public void DeleteCharacter(Character _character) { if (_character.IsPlayable == true && PCs.Contains(_character) == true) { PCs.Remove(_character); } else if (_character.IsPlayable == false && NPCs.Contains(_character) == true) { NPCs.Remove(_character); } }
public void RemoveNPC(NPC npc) { NPCs.Remove(npc); }