1 /*************************************************************************** 2 * (C) Copyright 2013 - Faiumoni e. V. * 3 *************************************************************************** 4 *************************************************************************** 5 * * 6 * This program is free software; you can redistribute it and/or modify * 7 * it under the terms of the GNU General Public License as published by * 8 * the Free Software Foundation; either version 2 of the License, or * 9 * (at your option) any later version. * 10 * * 11 ***************************************************************************/ 12 package games.stendhal.server.entity.mapstuff.area; 13 14 import games.stendhal.server.entity.Entity; 15 import games.stendhal.server.entity.RPEntity; 16 import marauroa.common.game.Definition.Type; 17 import marauroa.common.game.RPClass; 18 19 /** 20 * An entity that just acts as a visible obstacle like a wall. 21 */ 22 public class Wall extends AreaEntity { 23 24 /** 25 * Create a wall. 26 * 27 * @param width width 28 * @param height height 29 */ Wall(int width, int height)30 public Wall(int width, int height) { 31 super(width, height); 32 33 setRPClass("wall"); 34 put("type", "wall"); 35 setResistance(100); 36 } 37 38 generateRPClass()39 public static void generateRPClass() { 40 final RPClass clazz = new RPClass("wall"); 41 clazz.isA("area"); 42 clazz.addAttribute("class", Type.STRING); 43 } 44 45 /** 46 * Determine if this is an obstacle for another entity. 47 * 48 * @param entity 49 * The entity to check against. 50 * 51 * @return <code>true</code> if the other entity is an RPEntity, otherwise 52 * the default. 53 */ 54 @Override isObstacle(final Entity entity)55 public boolean isObstacle(final Entity entity) { 56 if (entity instanceof RPEntity) { 57 return true; 58 } 59 60 return super.isObstacle(entity); 61 } 62 } 63