20 package net.sf.gridarta.gui.map.renderer;
22 import java.util.Collections;
30 import org.jetbrains.annotations.NotNull;
31 import org.jetbrains.annotations.Nullable;
46 private final StringBuilder
sb =
new StringBuilder(
"<html>");
59 public void appendGameObject(@NotNull
final G gameObject,
final boolean alwaysInclude, @NotNull
final String prefix) {
60 final Map<String, String> fields = gameObjectParser != null ? gameObjectParser.
getModifiedFields(gameObject) : Collections.emptyMap();
63 if (alwaysInclude || !fields.isEmpty() || !gameObject.isEmpty()) {
67 sb.append(
"<br><hr>");
70 sb.append(
"<b>").append(
encode(gameObject.getBestName())).append(
"</b>");
71 for (
final Map.Entry<String, String> field : fields.entrySet()) {
76 for (
final G invGameObject : gameObject.reverse()) {
88 sb.append(error.getMessage().trim());
102 private static String
encode(@NotNull
final String str) {
103 final StringBuilder sb =
new StringBuilder(str.length());
104 for (
final char ch : str.toCharArray()) {
123 return sb.toString();
Utility class for string manipulation.
Reading and writing of maps, handling of paths.
This package contains the framework for validating maps.
Interface for classes that read or write GameObject instances.
static final Pattern PATTERN_NEWLINE
The pattern that matches a single newline ("\n").
Map< String, String > getModifiedFields(@NotNull G gameObject)
Returns the modified fields of a GameObject.
Super class of all errors that could occur during map validation.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
GameObjects are the objects based on Archetypes found on maps.
Interface for MapArchObjects.