PocketMine-MP 5.32.2 git-237b304ef9858756b018e44e8f298093f66f823b
Loading...
Searching...
No Matches
CameraFovInstruction.php
1<?php
2
3/*
4 * This file is part of BedrockProtocol.
5 * Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6 *
7 * BedrockProtocol is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13declare(strict_types=1);
14
15namespace pocketmine\network\mcpe\protocol\types\camera;
16
18
20
24 public function __construct(
25 private float $fieldOfView,
26 private float $easeTime,
27 private int $easeType,
28 private bool $clear,
29 ){}
30
31 public function getFieldOfView() : float{ return $this->fieldOfView; }
32
33 public function getEaseTime() : float{ return $this->easeTime; }
34
38 public function getEaseType() : int{ return $this->easeType; }
39
40 public function getClear() : bool{ return $this->clear; }
41
42 public static function read(PacketSerializer $in) : self{
43 $fieldOfView = $in->getLFloat();
44 $easeTime = $in->getLFloat();
45 $easeType = $in->getByte();
46 $clear = $in->getBool();
47 return new self(
48 $fieldOfView,
49 $easeTime,
50 $easeType,
51 $clear
52 );
53 }
54
55 public function write(PacketSerializer $out) : void{
56 $out->putLFloat($this->fieldOfView);
57 $out->putLFloat($this->easeTime);
58 $out->putByte($this->easeType);
59 $out->putBool($this->clear);
60 }
61}
__construct(private float $fieldOfView, private float $easeTime, private int $easeType, private bool $clear,)