pocketmine\nbt\tag\CompoundTag::getCount PHP Method

getCount() public method

public getCount ( )
    public function getCount()
    {
        $count = 0;
        foreach ($this as $tag) {
            if ($tag instanceof Tag) {
                ++$count;
            }
        }
        return $count;
    }

Usage Example

示例#1
0
 public function setNamedTag(CompoundTag $tag)
 {
     if ($tag->getCount() === 0) {
         return $this->clearNamedTag();
     }
     $this->cachedNBT = $tag;
     $this->tags = self::writeCompoundTag($tag);
     return $this;
 }
All Usage Examples Of pocketmine\nbt\tag\CompoundTag::getCount