1package com.runehive.game.world.object;
3import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
4import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
7import java.util.Optional;
129 private static final Int2ObjectMap<ObjectType>
idToType =
new Int2ObjectOpenHashMap<>(
values.length);
145 public static Optional<ObjectType>
valueOf(
final int id) {
146 return Optional.ofNullable(
idToType.get(
id));
The group of an object, which indicates its general class (e.g.
GROUND_DECORATION
The ground decoration object group, which may block a tile.
WALL_DECORATION
The wall decoration object group, which never blocks a tile.
ROOFING
The roof parts that disappear on a camera angle.
INTERACTABLE_OBJECT
The interactable object group, for objects that can be clicked and interacted with.
WALL
The wall object group, which may block a tile.
DIAGONAL_BOTTOM_EDGE_CONNECTING_ROOF
Represents diagonal bottom edge connecting roofs.
static final Int2ObjectMap< ObjectType > idToType
A mutable Map of int keys to ObjectType values.
final ObjectGroup group
The ObjectGroup this type is associated to.
STRAIGHT_OUTSIDE_WALL_DECORATION
Represents straight outside wall decorations.
STRAIGHT_BOTTOM_EDGE_ROOF
Represents straight bottom edge roofs.
final int id
The identification of this type.
final int getId()
Gets the identification of this type.
STRAIGHT_BOTTOM_EDGE_CONNECTING_CORNER_ROOF
Represents straight bottom edge connecting corner roofs.
DIAGONAL_OUTSIDE_WALL_DECORATION
Represents diagonal outside wall decorations.
DIAGONAL_INSIDE_WALL_DECORATION
Represents diagonal inside wall decorations.
STRAIGHT_SLOPED_ROOF
Represents straight sloped roofs.
static final ObjectType[] values
DIAGONAL_INTERIOR_WALL_DECORATION
Represents diagonal in wall decorations.
STRAIGHT_INSIDE_WALL_DECORATION
Represents straight inside wall decorations.
DIAGONAL_WALL
Represents diagonal walls, fences etc.
STRAIGHT_WALL
Represents straight walls, fences etc.
static Optional< ObjectType > valueOf(final int id)
Returns a ObjectType wrapped in an Optional for the specified id.
GENERAL_PROP
Represents all kinds of objects, trees, statues, signs, fountains etc.
WALKABLE_PROP
Represents ground objects like daisies etc.
DIAGONAL_SLOPED_CONNECTING_ROOF
Represents diagonal slope connecting roofs.
final ObjectGroup getGroup()
Gets the group of this type.
DIAGONAL_CORNER_WALL
Represents diagonal walls corner, fences etc connectors.
STRAIGHT_BOTTOM_EDGE_CONNECTING_ROOF
Represents straight bottom edge connecting roofs.
ENTIRE_WALL
Represents entire walls, fences etc corners.
GROUND_PROP
Represents ground decoration + map signs (quests, water fountains, shops, etc)
STRAIGHT_SLOPED_CORNER_CONNECTING_ROOF
Represents straight sloped corner connecting roofs.
STRAIGHT_FLAT_TOP_ROOF
Represents straight flat top roofs.
ObjectType(int id, ObjectGroup group)
Creates a new ObjectType.
WALL_CORNER
Represents straight wall corners, fences etc connectors.
STRAIGHT_SLOPED_CORNER_ROOF
Represents straight sloped corner roofs.
DIAGONAL_SLOPED_ROOF
Represents diagonal sloped roofs.