From: Astrid S. <ast...@us...> - 2009-01-30 19:04:57
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/mapstuff/portal In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18063/src/games/stendhal/server/entity/mapstuff/portal Modified Files: Gate.java Log Message: implement server side orientation Index: Gate.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/mapstuff/portal/Gate.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Gate.java 26 Nov 2008 23:40:45 -0000 1.5 --- Gate.java 30 Jan 2009 19:04:46 -0000 1.6 *************** *** 27,39 **** private boolean isOpen; ! public Gate() { ! setRPClass("gate"); put("type", "gate"); ! put(ORIENTATION, VERTICAL); setOpen(false); Logger.getLogger(Gate.class).info("gatecreated"); } public void open() { setOpen(true); --- 27,51 ---- private boolean isOpen; ! public Gate(final String orientation) { setRPClass("gate"); put("type", "gate"); ! setOrientation(orientation); setOpen(false); Logger.getLogger(Gate.class).info("gatecreated"); } + + public Gate() { + this(VERTICAL); + } + private void setOrientation(String orientation) { + if(HORIZONTAL.equals(orientation)){ + put(ORIENTATION, HORIZONTAL); + } else { + put(ORIENTATION, VERTICAL); + } + } + + public void open() { setOpen(true); |