Package games.stendhal.server.core.engine

Examples of games.stendhal.server.core.engine.StendhalRPZone


  /**
   * Tests for configureZone.
   */
  @Test
  public void testConfigureZone() {
    StendhalRPZone zone = new StendhalRPZone("testzone"20, 20);
    ZoneConfigurator conf = new NoTeleport();
    conf.configureZone(zone, null);
    assertFalse(zone.isTeleportInAllowed(0, 0));
    assertFalse(zone.isTeleportInAllowed(19, 19));
    assertFalse(zone.isTeleportOutAllowed(0, 0));
    assertFalse(zone.isTeleportOutAllowed(19, 19));
  }
View Full Code Here


  /**
   * Tests for configuring only part of the zone
   */
  @Test
  public void testConfigureSubZone() {
    StendhalRPZone zone = new StendhalRPZone("testzone"20, 20);
    ZoneConfigurator conf = new NoTeleport();
    Map<String, String> attributes = new HashMap<String, String>();
    attributes.put("x", "1");
    attributes.put("y", "1");
    attributes.put("width", "5");
    attributes.put("height", "5");
    conf.configureZone(zone, attributes);
   
    assertTrue("Outside the blocked area", zone.isTeleportOutAllowed(0, 0));
    assertFalse("Inside the blocked area", zone.isTeleportOutAllowed(1, 1));
    assertFalse("Inside the blocked area", zone.isTeleportOutAllowed(5, 5));
    assertTrue("Outside the blocked area", zone.isTeleportOutAllowed(6, 6));
   
    assertTrue("Outside the blocked area", zone.isTeleportInAllowed(0, 0));
    assertFalse("Inside the blocked area", zone.isTeleportInAllowed(1, 1));
    assertFalse("Inside the blocked area", zone.isTeleportInAllowed(5, 5));
    assertTrue("Outside the blocked area", zone.isTeleportInAllowed(6, 6));
  }
View Full Code Here

  /**
   * Tests for configureZone.
   */
  @Test
  public void testConfigureZone() {
    StendhalRPZone zone = new StendhalRPZone("testzone"20, 20);
    ZoneConfigurator conf = new NoTeleportOut();
    conf.configureZone(zone, null);
    assertTrue(zone.isTeleportInAllowed(0, 0));
    assertTrue(zone.isTeleportInAllowed(20, 20));
    assertFalse(zone.isTeleportOutAllowed(0, 0));
    assertFalse(zone.isTeleportOutAllowed(19, 19));
  }
View Full Code Here

  /**
   * Tests for configuring only part of the zone
   */
  @Test
  public void testConfigureSubZone() {
    StendhalRPZone zone = new StendhalRPZone("testzone"20, 20);
    ZoneConfigurator conf = new NoTeleportOut();
    Map<String, String> attributes = new HashMap<String, String>();
    attributes.put("x", "1");
    attributes.put("y", "1");
    attributes.put("width", "5");
    attributes.put("height", "5");
    conf.configureZone(zone, attributes);
    assertTrue("Outside the blocked area", zone.isTeleportOutAllowed(0, 0));
    assertFalse("Inside the blocked area", zone.isTeleportOutAllowed(1, 1));
    assertFalse("Inside the blocked area", zone.isTeleportOutAllowed(5, 5));
    assertTrue("Outside the blocked area", zone.isTeleportOutAllowed(6, 6));
    assertTrue(zone.isTeleportInAllowed(0, 0));
    assertTrue(zone.isTeleportInAllowed(19, 19));
  }
View Full Code Here

  @Before
  public void setup() {
    final MockStendhalRPRuleProcessor processor = MockStendhalRPRuleProcessor
        .get();

    final StendhalRPZone zone = new StendhalRPZone("testzone");
    SingletonRepository.getRPWorld().addRPZone(zone);

    final Player player1 = PlayerTestHelper.createPlayer("player1");
    processor.addPlayer(player1);
    zone.add(player1);

    final Player player2 = PlayerTestHelper.createPlayer("player2");
    processor.addPlayer(player2);
    zone.add(player2);

    final NPC npc = new SpeakerNPC("npc");
    zone.add(npc);
  }
View Full Code Here

   * Tests for unknownAttribute.
   */
  @Test
  public final void testUnknownAttribute() {
    Player player = PlayerTestHelper.createPlayer("bob");
    StendhalRPZone zone = new StendhalRPZone("testzone");
    zone.add(player);
    AlterAction action = new AlterAction();
    RPAction rpAction = new RPAction();
    rpAction.put("target", "#" + player.getID().getObjectID());
    rpAction.put("mode", "");
    rpAction.put("stat", "");
View Full Code Here

   * Tests for nameAttribute.
   */
  @Test
  public final void testNameAttribute() {
    Player player = PlayerTestHelper.createPlayer("bob");
    StendhalRPZone zone = new StendhalRPZone("testzone");
    zone.add(player);
    AlterAction action = new AlterAction();
    RPAction rpAction = new RPAction();
    rpAction.put("target", "#" + player.getID().getObjectID());
    rpAction.put("mode", "");
    rpAction.put("stat", "name");
View Full Code Here

   * Tests for adminlevelAttribute.
   */
  @Test
  public final void testAdminlevelAttribute() {
    Player player = PlayerTestHelper.createPlayer("bob");
    StendhalRPZone zone = new StendhalRPZone("testzone");
    zone.add(player);
    AlterAction action = new AlterAction();
    RPAction rpAction = new RPAction();
    rpAction.put("target", "#" + player.getID().getObjectID());
    rpAction.put("mode", "");
    rpAction.put("stat", "adminlevel");
View Full Code Here

   * Tests for titleAttribute.
   */
  @Test
  public final void testTitleAttribute() {
    Player player = PlayerTestHelper.createPlayer("bob");
    StendhalRPZone zone = new StendhalRPZone("testzone");
    zone.add(player);
    AlterAction action = new AlterAction();
    RPAction rpAction = new RPAction();
    rpAction.put("target", "#" + player.getID().getObjectID());
    rpAction.put("mode", "");
    rpAction.put("stat", "title");
View Full Code Here

   * Tests for validAttributeInvalidNumber.
   */
  @Test
  public final void testValidAttributeInvalidNumber() {
    Player player = PlayerTestHelper.createPlayer("bob");
    StendhalRPZone zone = new StendhalRPZone("testzone");
    zone.add(player);
    AlterAction action = new AlterAction();
    RPAction rpAction = new RPAction();
    rpAction.put("target", "#" + player.getID().getObjectID());
    rpAction.put("mode", "");
    rpAction.put("stat", "hp");
View Full Code Here

TOP

Related Classes of games.stendhal.server.core.engine.StendhalRPZone

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.