PocketMine-MP 5.41.1 git-fcc6fb5566a921cb669160c90f56fb68f5b29123
Loading...
Searching...
No Matches
CameraProgressOption.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
17use pmmp\encoding\ByteBufferReader;
18use pmmp\encoding\ByteBufferWriter;
19use pmmp\encoding\LE;
20
22
26 public function __construct(
27 private float $value,
28 private float $time,
29 private int $easeType,
30 ){}
31
32 public function getValue() : float{ return $this->value; }
33
34 public function getTime() : float{ return $this->time; }
35
39 public function getEaseType() : int{ return $this->easeType; }
40
41 public static function read(ByteBufferReader $in) : self{
42 $value = LE::readFloat($in);
43 $time = LE::readFloat($in);
44 $easeType = LE::readUnsignedInt($in);
45
46 return new self(
47 $value,
48 $time,
49 $easeType
50 );
51 }
52
53 public function write(ByteBufferWriter $out) : void{
54 LE::writeFloat($out, $this->value);
55 LE::writeFloat($out, $this->time);
56 LE::writeUnsignedInt($out, $this->easeType);
57 }
58}
__construct(private float $value, private float $time, private int $easeType,)