Crossfire JXClient, Trunk  R20561
AccountPlayerBuilder.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.server.crossfire;
23 
25 import org.jetbrains.annotations.NotNull;
26 
33 public class AccountPlayerBuilder {
34 
38  @NotNull
39  private String name = "";
40 
44  @NotNull
45  private String cClass = "";
46 
50  @NotNull
51  private String race = "";
52 
56  private int level;
57 
61  @NotNull
62  private String face = "";
63 
67  @NotNull
68  private String party = "";
69 
73  @NotNull
74  private String map = "";
75 
79  private int faceNumber;
80 
86  @NotNull
88  final CharacterInformation characterInformation = new CharacterInformation(name, cClass, race, face, party, map, level, faceNumber);
89  name = "";
90  cClass = "";
91  race = "";
92  level = 0;
93  face = "";
94  party = "";
95  map = "";
96  faceNumber = 0;
97  return characterInformation;
98  }
99 
104  public void setName(@NotNull final String name) {
105  this.name = name;
106  }
107 
112  public void setClass(@NotNull final String cClass) {
113  this.cClass = cClass;
114  }
115 
120  public void setRace(@NotNull final String race) {
121  this.race = race;
122  }
123 
128  public void setLevel(final int level) {
129  this.level = level;
130  }
131 
136  public void setFace(@NotNull final String face) {
137  this.face = face;
138  }
139 
144  public void setParty(@NotNull final String party) {
145  this.party = party;
146  }
147 
152  public void setMap(@NotNull final String map) {
153  this.map = map;
154  }
155 
160  public void setFaceNumber(final int faceNumber) {
161  this.faceNumber = faceNumber;
162  }
163 
164 }
void setClass(@NotNull final String cClass)
Sets the character's class.
CharacterInformation finish()
Finishes parsing an entry an returns the CharacterInformation for the entry.
Builder for CharacterInformation instances while parsing an "accountplayers" packet.
void setRace(@NotNull final String race)
Sets the character's race.
void setFace(@NotNull final String face)
Sets the character's face.
void setFaceNumber(final int faceNumber)
Sets the character's face number.
void setMap(@NotNull final String map)
Sets the character's map.
void setParty(@NotNull final String party)
Sets the character's party.
void setName(@NotNull final String name)
Sets the character's name.
void setLevel(final int level)
Sets the character's level.