20 package net.sf.gridarta.model.smoothface;
22 import java.util.Collections;
23 import java.util.Iterator;
25 import java.util.TreeMap;
29 import org.jetbrains.annotations.NotNull;
30 import org.jetbrains.annotations.Nullable;
36 public class SmoothFaces implements Iterable<Map.Entry<String, SmoothFace>> {
42 private final Map<String, SmoothFace>
smoothFaces =
new TreeMap<>();
64 final SmoothFace oldSmoothFace = smoothFaces.get(smoothFace.getFace());
65 if (oldSmoothFace != null) {
66 if (oldSmoothFace.
getValue().equals(smoothFace.getValue())) {
73 smoothFaces.put(smoothFace.getFace(), smoothFace);
85 if (faceName == null) {
86 faceName = gameObject.getArchetype().getFaceName();
88 if (faceName == null) {
91 final SmoothFace smoothFace = smoothFaces.get(faceName);
92 if (smoothFace == null) {
101 return Collections.unmodifiableMap(smoothFaces).entrySet().iterator();
final Map< String, SmoothFace > smoothFaces
The defined SmoothFaces.
FaceObject getSmoothFace(@NotNull final GameObject<?, ?, ?> gameObject)
Returns the smooth faces for a GameObject.
Common interface for FaceObject.
void add(@NotNull final SmoothFace smoothFace)
Adds a SmoothFace instance.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
final FaceObjects faceObjects
The FaceObjects for looking up faces.
E get(@NotNull String objectName)
Gets a AbstractNamedObject.
Collection of all smoothing information.
Iterator< Map.Entry< String, SmoothFace > > iterator()
GameObjects are the objects based on Archetypes found on maps.
Smoothing information for one face name.
FaceObjects is a container for FaceObjects.
The face is the appearance of an object.
String getFaceName()
Get the faceName, which is the name of the face as usable by the "face" attribute.
String getValue()
Returns the smooth information.
SmoothFaces(@NotNull final FaceObjects faceObjects)
Creates a new instance.
Thrown to indicate that a SmoothFace instance is not unique.