Crossfire JXClient, Trunk  R20561
NewCharInfo.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff.
19  * Copyright (C) 2006-2011 Andreas Kirschbaum.
20  */
21 
22 package com.realtime.crossfire.jxclient.character;
23 
24 import java.util.ArrayList;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.List;
28 import org.jetbrains.annotations.NotNull;
29 
34 public class NewCharInfo {
35 
39  private final int points;
40 
44  private final int minValue;
45 
49  private final int maxValue;
50 
54  @NotNull
55  private final List<String> statNames = new ArrayList<>();
56 
60  private final boolean raceChoice;
61 
65  private final boolean classChoice;
66 
70  private final boolean startingMapChoice;
71 
82  public NewCharInfo(final int points, final int minValue, final int maxValue, @NotNull final Collection<String> statNames, final boolean raceChoice, final boolean classChoice, final boolean startingMapChoice) {
83  this.points = points;
84  this.minValue = minValue;
85  this.maxValue = maxValue;
86  this.raceChoice = raceChoice;
87  this.classChoice = classChoice;
88  this.startingMapChoice = startingMapChoice;
89  this.statNames.addAll(statNames);
90  }
91 
96  public int getPoints() {
97  return points;
98  }
99 
104  public int getMinValue() {
105  return minValue;
106  }
107 
112  public int getMaxValue() {
113  return maxValue;
114  }
115 
120  @NotNull
121  public List<String> getStatNames() {
122  return Collections.unmodifiableList(statNames);
123  }
124 
129  public boolean isRaceChoice() {
130  return raceChoice;
131  }
132 
137  public boolean isClassChoice() {
138  return classChoice;
139  }
140 
145  public boolean isStartingMapChoice() {
146  return startingMapChoice;
147  }
148 
152  @NotNull
153  @Override
154  public String toString() {
155  return "points="+points+", statRange="+minValue+".."+maxValue+", stats="+statNames+", race="+raceChoice+", class="+classChoice+", startingMap="+startingMapChoice;
156  }
157 
158 }
boolean isStartingMapChoice()
Returns whether a starting map should be selected.
int getMinValue()
Returns the minimum stat value.
boolean isClassChoice()
Returns whether a class should be selected.
General information for creating new characters.
NewCharInfo(final int points, final int minValue, final int maxValue, @NotNull final Collection< String > statNames, final boolean raceChoice, final boolean classChoice, final boolean startingMapChoice)
Creates a new instance.
final int points
The total number of points the character has to spend.
final List< String > statNames
The stat names to set.
final int maxValue
The maximum value for stats.
List< String > getStatNames()
Returns the stat names to spend on.
boolean isRaceChoice()
Returns whether a race should be selected.
final int minValue
The minimum value for stats.
final boolean classChoice
Whether a class should be selected.
int getMaxValue()
Returns the maximum stat value.
int getPoints()
Returns the number of points the character has to spend.
final boolean startingMapChoice
Whether a starting map should be selected.
final boolean raceChoice
Whether a race should be selected.