26 public function __construct(
27 private ?
string $presetId,
28 private ?CameraAimAssistTargetMode $targetMode,
30 private ?
float $distance,
33 public function getPresetId() : ?
string{
return $this->presetId; }
35 public function getTargetMode() : ?CameraAimAssistTargetMode{
return $this->targetMode; }
37 public function getViewAngle() : ?
Vector2{
return $this->viewAngle; }
39 public function getDistance() : ?
float{
return $this->distance; }
41 public static function read(ByteBufferReader $in) :
self{
42 $presetId = CommonTypes::readOptional($in, CommonTypes::getString(...));
43 $targetMode = CommonTypes::readOptional($in, fn() => CameraAimAssistTargetMode::fromPacket(Byte::readUnsigned($in)));
44 $viewAngle = CommonTypes::readOptional($in, CommonTypes::getVector2(...));
45 $distance = CommonTypes::readOptional($in, LE::readFloat(...));
55 public function write(ByteBufferWriter $out) :
void{
56 CommonTypes::writeOptional($out, $this->presetId, CommonTypes::putString(...));
57 CommonTypes::writeOptional($out, $this->targetMode, fn(ByteBufferWriter $out, CameraAimAssistTargetMode $v) => Byte::writeUnsigned($out, $v->value));
58 CommonTypes::writeOptional($out, $this->viewAngle, CommonTypes::putVector2(...));
59 CommonTypes::writeOptional($out, $this->distance, LE::writeFloat(...));