public static List <GameEntity> GetVisibleObjects(PlayersViewAreas viewAreas, PlayersViewAreas.PlayerViewAreaInfo viewArea, IEnumerable <GameEntity> entities) { if (viewAreas.sendAll) { return(entities.ToList()); } var playerVisible = viewArea.lastVisible; return(entities.Where(withView => playerVisible.Contains(withView.id.value)).ToList()); }
private List <GameEntity> GetVisibleObjects(PlayersViewAreas.PlayerViewAreaInfo viewArea, IEnumerable <GameEntity> entities) { return(GetVisibleObjects(viewAreas, viewArea, entities)); }