Files
magicbane/src/engine/devcmd/cmds/SlotTestCmd.java
T

80 lines
2.5 KiB
Java
Raw Normal View History

2023-04-24 16:41:25 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager;
import engine.objects.*;
2023-05-03 14:43:49 -04:00
import java.util.ArrayList;
2023-04-24 16:41:25 -04:00
public class SlotTestCmd extends AbstractDevCmd {
public SlotTestCmd() {
super("slottest");
}
@Override
protected void _doCmd(PlayerCharacter playerCharacter, String[] args,
AbstractGameObject target) {
2023-05-03 14:43:49 -04:00
ArrayList<BuildingLocation> buildingLocations;
2023-04-24 16:41:25 -04:00
String outString = "Available Slots\r\n";
if (target == null)
return;
if (target.getObjectType() != GameObjectType.Building)
return;
2023-05-03 14:43:49 -04:00
Building building = (Building) target;
buildingLocations = BuildingManager._slotLocations.get(building.meshUUID);
if (buildingLocations == null) {
outString = "No slot information for mesh: " + building.meshUUID;
ChatManager.chatSystemInfo(playerCharacter, outString);
return;
}
2023-04-24 16:41:25 -04:00
for (BuildingLocation buildingLocation : BuildingManager._slotLocations.get(building.meshUUID))
outString += buildingLocation.getSlot() + buildingLocation.getLocation().toString() + "\r\n";
2023-04-24 16:41:25 -04:00
2023-05-03 14:43:49 -04:00
outString += "\r\nNext Available Slot: " + BuildingManager.getAvailableSlot(building);
2023-04-24 16:41:25 -04:00
if (building.getHirelings().isEmpty() == false) {
outString += "\r\n\r\n";
2023-05-03 14:43:49 -04:00
outString += "Hirelings List:";
2023-04-24 16:41:25 -04:00
2023-05-03 14:43:49 -04:00
for (AbstractCharacter hireling : building.getHirelings().keySet())
outString += "\r\n" + hireling.getName() + " slot : " + building.getHirelings().get(hireling);
2023-04-24 16:41:25 -04:00
}
ChatManager.chatSystemInfo(playerCharacter,outString);
}
@Override
protected String _getHelpString() {
2023-05-03 14:43:49 -04:00
return "Displays slot information for building";
2023-04-24 16:41:25 -04:00
}
@Override
protected String _getUsageString() {
2023-05-03 14:43:49 -04:00
return "./slottest <target builing>";
2023-04-24 16:41:25 -04:00
}
}