22 package com.realtime.crossfire.jxclient.server.crossfire;
25 import java.util.ArrayList;
26 import java.util.Collection;
27 import java.util.Collections;
28 import org.jetbrains.annotations.NotNull;
29 import org.jetbrains.annotations.Nullable;
63 private final Collection<StartingMap>
startingMaps =
new ArrayList<>();
72 this.archName = archName.clone();
82 public void setName(@NotNull
final String name) {
83 if (archName == null) {
84 System.err.println(
"missing archetype name for name '"+name+
"' in startingmap block");
87 if (this.name != null) {
88 System.err.println(
"duplicate name '"+name+
"' in startingmap block; previous name was '"+this.name+
"'");
100 if (archName == null) {
101 System.err.println(
"missing archetype name for description '"+description+
"' in startingmap block");
104 if (this.description != null) {
105 System.err.println(
"duplicate description '"+description+
"' in startingmap block; previous description was '"+this.description+
"'");
116 public Collection<StartingMap>
finish() {
118 return Collections.unmodifiableCollection(startingMaps);
126 if (archName == null) {
130 startingMaps.add(
new StartingMap(archName, name == null ?
"" : name, description == null ?
"" : description));
Builder for StartingMap instances while parsing a "replyinfo startingmap" response packet...
One possible starting map for character creation.
void addStartingMap()
Adds a new StartingMap entry to startingMaps for the current entry.
Collection< StartingMap > finish()
Finishes parsing.
void setArchName(@NotNull final byte[] archName)
Starts a new starting map entry.
void setName(@NotNull final String name)
Sets the name of the current entry.
final Collection< StartingMap > startingMaps
The StartingMap entries parsed so far.
void setDescription(@NotNull final String description)
Sets the description of the current entry.
String description
The description of this entry.
String name
The proper name of this entry.
byte [] archName
The archetype name of the current entry.