public void removeEntity(ChexelEntity toRemove) { if (entities.ContainsKey(toRemove.pos)) { entities.Remove(toRemove.pos); toRemove.stop(); } }
public bool moveEntity(ChexelEntity toMove, vector2 newPos) { if (checkCollide(toMove.pos, newPos)) { return(false); } else { removeEntity(toMove); toMove.pos = newPos; return(addEntity(toMove)); } }
public bool addEntity(ChexelEntity toAdd) { if (entities.ContainsKey(toAdd.pos)) { return(false); } else { entities.Add(toAdd.pos, toAdd); if (isStarted) { toAdd.start(); } return(true); } }