public void addEntity(EntityWithLastPosition entityWithLastPosition) { if (!entitySet.Contains(entityWithLastPosition)) { LoggerUtil.logInfo("Added an item with hash code in entity: " + entityWithLastPosition.GetHashCode()); entitySet.Add(entityWithLastPosition, 1); } }
private void removeFromSetIfCloseEnoughToPlayer(EntityWithLastPosition entityWithLastPosition, List <EntityWithLastPosition> toBeRemovedFromSet) { if (World.GetDistance(player.Position, entityWithLastPosition.getEntity().Position) < DISTANCE_RANGE_FOR_CLOSEST) { entityWithLastPosition.getEntity().Speed = 0; toBeRemovedFromSet.Add(entityWithLastPosition); } }