Files
lakebane/src/engine/devcmd/cmds/AuditHeightMapCmd.java
T

71 lines
2.6 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.InterestManagement.HeightMap;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ZoneManager;
import engine.math.Vector2f;
import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
import engine.objects.Zone;
public class AuditHeightMapCmd extends AbstractDevCmd {
2023-07-15 09:23:48 -04:00
public AuditHeightMapCmd() {
2022-04-30 09:41:17 -04:00
super("auditheightmap");
}
2023-07-15 09:23:48 -04:00
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] words,
AbstractGameObject target) {
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
int count = Integer.parseInt(words[0]);
long start = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
Zone currentZone = ZoneManager.findSmallestZone(pcSender.getLoc());
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
Vector3fImmutable currentLoc = Vector3fImmutable.getRandomPointInCircle(currentZone.getLoc(), currentZone.getBounds().getHalfExtents().x < currentZone.getBounds().getHalfExtents().y ? currentZone.getBounds().getHalfExtents().x : currentZone.getBounds().getHalfExtents().y);
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(currentLoc, currentZone);
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
if (currentZone != null && currentZone.getHeightMap() != null) {
float altitude = currentZone.getHeightMap().getInterpolatedTerrainHeight(zoneLoc);
float outsetAltitude = HeightMap.getOutsetHeight(altitude, currentZone, pcSender.getLoc());
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
}
long end = System.currentTimeMillis();
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
long delta = end - start;
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
this.throwbackInfo(pcSender, "Audit Heightmap took " + delta + " ms to run " + count + " times!");
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
@Override
protected String _getUsageString() {
return "' /auditmobs [zone.UUID]'";
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
@Override
protected String _getHelpString() {
return "Audits all the mobs in a zone.";
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
}
2022-04-30 09:41:17 -04:00
}