From: Hendrik B. <nh...@us...> - 2013-01-10 20:09:01
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/mapstuff/block In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2666/src/games/stendhal/server/entity/mapstuff/block Modified Files: Block.java Log Message: fixed warnings Index: Block.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/mapstuff/block/Block.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Block.java 21 Dec 2012 14:30:56 -0000 1.1 --- Block.java 10 Jan 2013 20:08:26 -0000 1.2 *************** *** 1,8 **** package games.stendhal.server.entity.mapstuff.block; - import java.awt.geom.Rectangle2D; - - import org.apache.log4j.Logger; - import games.stendhal.common.Direction; import games.stendhal.server.core.engine.StendhalRPZone; --- 1,4 ---- *************** *** 13,16 **** --- 9,15 ---- import games.stendhal.server.entity.RPEntity; import games.stendhal.server.entity.mapstuff.area.AreaEntity; + + import java.awt.geom.Rectangle2D; + import marauroa.common.game.Definition; import marauroa.common.game.Definition.Type; *************** *** 20,30 **** /** * A solid, movable block on a map ! * * @author madmetzger */ public class Block extends AreaEntity implements ZoneEnterExitListener, MovementListener{ ! ! private static final Logger logger = Logger.getLogger(Block.class); ! public static void generateRPClass() { RPClass clazz = new RPClass("block"); --- 19,27 ---- /** * A solid, movable block on a map ! * * @author madmetzger */ public class Block extends AreaEntity implements ZoneEnterExitListener, MovementListener{ ! public static void generateRPClass() { RPClass clazz = new RPClass("block"); *************** *** 36,43 **** clazz.addAttribute("multi", Type.FLAG, Definition.HIDDEN); } ! /** * Create a new Block a (startX, startY) ! * * @param startX * initial x-coordinate --- 33,40 ---- clazz.addAttribute("multi", Type.FLAG, Definition.HIDDEN); } ! /** * Create a new Block a (startX, startY) ! * * @param startX * initial x-coordinate *************** *** 58,62 **** this.reset(); } ! /** * Resets the block position to its initial state --- 55,59 ---- this.reset(); } ! /** * Resets the block position to its initial state *************** *** 66,70 **** this.notifyWorldAboutChanges(); } ! /** * Push this Block into a given direction --- 63,67 ---- this.notifyWorldAboutChanges(); } ! /** * Push this Block into a given direction *************** *** 77,81 **** } } ! private boolean wasPushed() { boolean xChanged = this.getInt("x") != this.getInt("start_x"); --- 74,78 ---- } } ! private boolean wasPushed() { boolean xChanged = this.getInt("x") != this.getInt("start_x"); *************** *** 83,91 **** return xChanged || yChanged; } ! private boolean mayBePushed() { boolean pushed = wasPushed(); boolean multiPush = this.getBool("multi"); ! if(multiPush) { // multi push always allows pushing --- 80,88 ---- return xChanged || yChanged; } ! private boolean mayBePushed() { boolean pushed = wasPushed(); boolean multiPush = this.getBool("multi"); ! if(multiPush) { // multi push always allows pushing *************** *** 96,102 **** return !pushed; } ! } ! @Override public void onEntered(ActiveEntity entity, StendhalRPZone zone, int newX, --- 93,99 ---- return !pushed; } ! } ! @Override public void onEntered(ActiveEntity entity, StendhalRPZone zone, int newX, *************** *** 148,152 **** int oldY, int newX, int newY) { Rectangle2D oldA = new Rectangle2D.Double(oldX, oldY, entity.getWidth(), entity.getHeight()); ! Rectangle2D newA = new Rectangle2D.Double(newX, newY, entity.getWidth(), entity.getHeight());; Direction d = Direction.getAreaDirectionTowardsArea(oldA, newA); this.push(d); --- 145,149 ---- int oldY, int newX, int newY) { Rectangle2D oldA = new Rectangle2D.Double(oldX, oldY, entity.getWidth(), entity.getHeight()); ! Rectangle2D newA = new Rectangle2D.Double(newX, newY, entity.getWidth(), entity.getHeight()); Direction d = Direction.getAreaDirectionTowardsArea(oldA, newA); this.push(d); |