View Javadoc

1   package erland.game.tileadventure;
2   
3   import erland.util.ParameterSerializable;
4   import erland.util.ParameterValueStorageExInterface;
5   import erland.util.StringUtil;
6   
7   /*
8    * Copyright (C) 2004 Erland Isaksson (erland_i@hotmail.com)
9    *
10   * This program is free software; you can redistribute it and/or
11   * modify it under the terms of the GNU General Public License
12   * as published by the Free Software Foundation; either version 2
13   * of the License, or (at your option) any later version.
14   *
15   * This program is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   * GNU General Public License for more details.
19   *
20   * You should have received a copy of the GNU General Public License
21   * along with this program; if not, write to the Free Software
22   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23   * 
24   */
25  
26  public class RoomExtendedLevelInfo implements ParameterSerializable {
27      private int sizeX;
28      private int sizeY;
29      private int sizeZ;
30  
31      public void write(ParameterValueStorageExInterface out) {
32          out.setParameter("sizeX",String.valueOf(sizeX));
33          out.setParameter("sizeY",String.valueOf(sizeY));
34          out.setParameter("sizeZ",String.valueOf(sizeZ));
35      }
36  
37      public void read(ParameterValueStorageExInterface in) {
38          sizeX = StringUtil.asInteger(in.getParameter("sizeX"),new Integer(0)).intValue();
39          sizeY = StringUtil.asInteger(in.getParameter("sizeY"),new Integer(0)).intValue();
40          sizeZ = StringUtil.asInteger(in.getParameter("sizeZ"),new Integer(0)).intValue();
41      }
42  
43      public int getSizeX() {
44          return sizeX;
45      }
46  
47      public void setSizeX(int sizeX) {
48          this.sizeX = sizeX;
49      }
50  
51      public int getSizeY() {
52          return sizeY;
53      }
54  
55      public void setSizeY(int sizeY) {
56          this.sizeY = sizeY;
57      }
58  
59      public int getSizeZ() {
60          return sizeZ;
61      }
62  
63      public void setSizeZ(int sizeZ) {
64          this.sizeZ = sizeZ;
65      }
66  }