Package utilities

Class PlayerTestHelper

java.lang.Object
utilities.PlayerTestHelper
Direct Known Subclasses:
AchievementTestHelper, QuestHelper

public abstract class PlayerTestHelper extends Object
  • Constructor Details

    • PlayerTestHelper

      public PlayerTestHelper()
  • Method Details

    • createPlayer

      public static Player createPlayer(String name)
      Create a named player.
      Parameters:
      name -
      Returns:
      player
    • registerPlayer

      public static void registerPlayer(Player player, String zoneName)
      Register a player in rule processor, world and zone.
      Parameters:
      player -
      zoneName -
    • registerPlayer

      public static void registerPlayer(Player player, StendhalRPZone zone)
      Register a player in rule processor, world and zone.
      Parameters:
      player -
      zone -
    • registerPlayer

      public static void registerPlayer(Player player)
      Register a player in rule processor and world.
      Parameters:
      player -
    • createPlayerWithOutFit

      public static Player createPlayerWithOutFit(String name)
    • unregisterPlayer

      public static void unregisterPlayer(Player player, StendhalRPZone zone)
      Remove a player from rule processor, world and zone.
      Parameters:
      player -
      zone -
    • removePlayer

      public static void removePlayer(String playerName, StendhalRPZone zone)
      Remove a player from rule processor, world and zone.
      Parameters:
      playerName -
      zone -
    • removePlayer

      public static void removePlayer(String playerName, String zoneName)
      Remove a player from rule processor, world and zone.
      Parameters:
      playerName -
      zoneName -
    • removePlayer

      public static void removePlayer(String playerName)
      Remove a player from world and rule processor.
      Parameters:
      playerName -
    • removePlayer

      public static void removePlayer(Player player)
      Remove a player from world and rule processor.
      Parameters:
      player -
    • removeAllPlayers

      public static void removeAllPlayers()
      Remove all players from world and rule processor.
    • equipWithMoney

      public static boolean equipWithMoney(Player player, int amount)
      Equip the player with the given amount of money.
      Parameters:
      player -
      amount -
      Returns:
      success flag
    • equipWithItem

      public static boolean equipWithItem(Player player, String clazz)
      Equip the player with the given items.
      Parameters:
      player -
      clazz -
      Returns:
      success flag
    • equipWithItem

      public static boolean equipWithItem(Player player, String clazz, String info)
      Equip the player with the given item and set the given item string.
      Parameters:
      player -
      clazz -
      info -
      Returns:
      success flag
    • equipWithStackableItem

      public static boolean equipWithStackableItem(Player player, String clazz, int amount)
      Equip the player with the given amount of items.
      Parameters:
      player -
      clazz -
      amount -
      Returns:
      success flag
    • equipWithItemToSlot

      public static boolean equipWithItemToSlot(Player player, String clazz, String slot)
      Parameters:
      player -
      clazz -
      slot -
      Returns:
      true if it could be equipped to slot, false otherwise
    • resetNPC

      public static void resetNPC(SpeakerNPC npc)
      Reset the conversation state of the NPC.
      Parameters:
      npc - SpeakerNPC
    • resetNPC

      public static void resetNPC(String npcName)
      Reset the conversation state of the named NPC.
      Parameters:
      npcName - NPC string name
    • removeNPC

      public static boolean removeNPC(String npcName)
      Remove the named NPC.
      Parameters:
      npcName -
    • addEmptySlots

      public static void addEmptySlots(Player player)
    • generateEntityRPClasses

      public static void generateEntityRPClasses()
    • generateNPCRPClasses

      public static void generateNPCRPClasses()
    • generatePlayerRPClasses

      public static void generatePlayerRPClasses()
    • generateCreatureRPClasses

      public static void generateCreatureRPClasses()
    • dumpQuests

      public static void dumpQuests(Player player)
    • setPastTime

      public static void setPastTime(Player player, String questSlot, int index, long seconds)
      Set the (order) time in a quest slot back the specified number of seconds.
      Parameters:
      player -
      questSlot -
      index -
      seconds -
    • getPrivateReply

      public static String getPrivateReply(Player player)
      Query the player's events for private messages.
      Parameters:
      player -
      Returns:
      message text