Package utilities
Class PlayerTestHelper
java.lang.Object
utilities.PlayerTestHelper
- Direct Known Subclasses:
AchievementTestHelper,QuestHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEmptySlots(Player player) static PlayercreatePlayer(String name) Create a named player.static PlayercreatePlayerWithOutFit(String name) static voiddumpQuests(Player player) static booleanequipWithItem(Player player, String clazz) Equip the player with the given items.static booleanequipWithItem(Player player, String clazz, String info) Equip the player with the given item and set the given item string.static booleanequipWithItemToSlot(Player player, String clazz, String slot) static booleanequipWithMoney(Player player, int amount) Equip the player with the given amount of money.static booleanequipWithStackableItem(Player player, String clazz, int amount) Equip the player with the given amount of items.static voidstatic voidstatic voidstatic voidstatic StringgetPrivateReply(Player player) Query the player's events for private messages.static voidregisterPlayer(Player player) Register a player in rule processor and world.static voidregisterPlayer(Player player, StendhalRPZone zone) Register a player in rule processor, world and zone.static voidregisterPlayer(Player player, String zoneName) Register a player in rule processor, world and zone.static voidRemove all players from world and rule processor.static booleanRemove the named NPC.static voidremovePlayer(Player player) Remove a player from world and rule processor.static voidremovePlayer(String playerName) Remove a player from world and rule processor.static voidremovePlayer(String playerName, StendhalRPZone zone) Remove a player from rule processor, world and zone.static voidremovePlayer(String playerName, String zoneName) Remove a player from rule processor, world and zone.static voidresetNPC(SpeakerNPC npc) Reset the conversation state of the NPC.static voidReset the conversation state of the named NPC.static voidsetPastTime(Player player, String questSlot, int index, long seconds) Set the (order) time in a quest slot back the specified number of seconds.static voidunregisterPlayer(Player player, StendhalRPZone zone) Remove a player from rule processor, world and zone.
-
Constructor Details
-
PlayerTestHelper
public PlayerTestHelper()
-
-
Method Details
-
createPlayer
Create a named player.- Parameters:
name-- Returns:
- player
-
registerPlayer
Register a player in rule processor, world and zone.- Parameters:
player-zoneName-
-
registerPlayer
Register a player in rule processor, world and zone.- Parameters:
player-zone-
-
registerPlayer
Register a player in rule processor and world.- Parameters:
player-
-
createPlayerWithOutFit
-
unregisterPlayer
Remove a player from rule processor, world and zone.- Parameters:
player-zone-
-
removePlayer
Remove a player from rule processor, world and zone.- Parameters:
playerName-zone-
-
removePlayer
Remove a player from rule processor, world and zone.- Parameters:
playerName-zoneName-
-
removePlayer
Remove a player from world and rule processor.- Parameters:
playerName-
-
removePlayer
Remove a player from world and rule processor.- Parameters:
player-
-
removeAllPlayers
public static void removeAllPlayers()Remove all players from world and rule processor. -
equipWithMoney
Equip the player with the given amount of money.- Parameters:
player-amount-- Returns:
- success flag
-
equipWithItem
Equip the player with the given items.- Parameters:
player-clazz-- Returns:
- success flag
-
equipWithItem
Equip the player with the given item and set the given item string.- Parameters:
player-clazz-info-- Returns:
- success flag
-
equipWithStackableItem
Equip the player with the given amount of items.- Parameters:
player-clazz-amount-- Returns:
- success flag
-
equipWithItemToSlot
- Parameters:
player-clazz-slot-- Returns:
- true if it could be equipped to slot, false otherwise
-
resetNPC
Reset the conversation state of the NPC.- Parameters:
npc- SpeakerNPC
-
resetNPC
Reset the conversation state of the named NPC.- Parameters:
npcName- NPC string name
-
removeNPC
Remove the named NPC.- Parameters:
npcName-
-
addEmptySlots
-
generateEntityRPClasses
public static void generateEntityRPClasses() -
generateNPCRPClasses
public static void generateNPCRPClasses() -
generatePlayerRPClasses
public static void generatePlayerRPClasses() -
generateCreatureRPClasses
public static void generateCreatureRPClasses() -
dumpQuests
-
setPastTime
Set the (order) time in a quest slot back the specified number of seconds.- Parameters:
player-questSlot-index-seconds-
-
getPrivateReply
Query the player's events for private messages.- Parameters:
player-- Returns:
- message text
-