Add getNPCsCount

This commit is contained in:
slawkens 2025-05-24 11:54:00 +02:00
parent ae847ff9a6
commit 7d435ff643

View File

@ -219,11 +219,16 @@ class OTS_InfoRespond extends DOMDocument
* @return int Count of monsters.
* @throws DOMException On DOM operation error.
*/
public function getMonstersCount()
public function getMonstersCount(): int
{
return (int) $this->documentElement->getElementsByTagName('monsters')->item(0)->getAttribute('total');
}
public function getNPCsCount(): int
{
return (int) $this->documentElement->getElementsByTagName('npcs')->item(0)->getAttribute('total');
}
/**
* Returns map name.
*