mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Add extra sector functionality.
This commit is contained in:
@@ -18,11 +18,6 @@ public final class StaticObject extends Entity {
|
||||
*/
|
||||
private final ObjectDefinition definition;
|
||||
|
||||
/**
|
||||
* The object's id.
|
||||
*/
|
||||
private final int id;
|
||||
|
||||
/**
|
||||
* The object's rotation.
|
||||
*/
|
||||
@@ -36,14 +31,13 @@ public final class StaticObject extends Entity {
|
||||
/**
|
||||
* Creates a new static object.
|
||||
*
|
||||
* @param def The object's id.
|
||||
* @param id The object's id.
|
||||
* @param position The position.
|
||||
* @param type The type code of the object.
|
||||
* @param rotation The rotation of the object.
|
||||
*/
|
||||
public StaticObject(int id, Position position, int type, int rotation) {
|
||||
super(position);
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.rotation = rotation;
|
||||
definition = ObjectDefinition.lookup(id);
|
||||
@@ -63,15 +57,6 @@ public final class StaticObject extends Entity {
|
||||
return EntityType.STATIC_OBJECT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the id of the object.
|
||||
*
|
||||
* @return The object id.
|
||||
*/
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the object's rotation.
|
||||
*
|
||||
@@ -92,7 +77,8 @@ public final class StaticObject extends Entity {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return StaticObject.class.getName() + " [id=" + id + ", type=" + type + ", rotation=" + rotation + "]";
|
||||
return StaticObject.class.getName() + " [id=" + definition.getId() + ", type=" + type + ", rotation="
|
||||
+ rotation + "]";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,6 +75,15 @@ public final class Sector {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link List} of {@link Entity}s.
|
||||
*
|
||||
* @return The list.
|
||||
*/
|
||||
public List<Entity> getEntities() {
|
||||
return new ArrayList<>(entities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies the listeners registered to this sector that an update has occurred.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.apollo.game.model.sector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -84,6 +86,15 @@ public final class SectorRepository {
|
||||
return sector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link List} of {@link Sector}s.
|
||||
*
|
||||
* @return The list.
|
||||
*/
|
||||
public List<Sector> getSectors() {
|
||||
return new ArrayList<>(sectors.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a {@link Sector} from the repository, if permitted.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user