mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-08 00:39:10 +00:00
Add method to get every entity in a Sector.
This commit is contained in:
@@ -100,7 +100,19 @@ public final class Sector {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a shallow copy of the {@link List} of {@link Entity}s. The returned type will be {@link ImmutableList}.
|
||||
* Gets an {@link ImmutableList} containing every {@link Entity} in this sector.
|
||||
*
|
||||
* @return The list.
|
||||
*/
|
||||
public List<Entity> getEntities() {
|
||||
List<Entity> combined = new ArrayList<>();
|
||||
this.entities.values().forEach(entities -> combined.addAll(entities));
|
||||
return ImmutableList.copyOf(combined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a shallow copy of the {@link List} of {@link Entity} objects at the specified {@link Position}. The returned
|
||||
* type will be {@link ImmutableList}.
|
||||
*
|
||||
* @param position The position containing the entities.
|
||||
* @return The list.
|
||||
|
||||
Reference in New Issue
Block a user