PocketMine-MP
5.18.1 git-9381fc4172e5dce4cada1cb356050c8a2ab57b94
CameraFadeInstruction.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
13
declare(strict_types=1);
14
15
namespace
pocketmine\network\mcpe\protocol\types\camera;
16
17
use
pocketmine\network\mcpe\protocol\serializer\PacketSerializer
;
18
use
pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionColor
as Color;
19
use
pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionTime
as Time;
20
21
final
class
CameraFadeInstruction
{
22
23
public
function
__construct(
24
private
?Time $time,
25
private
?
Color
$color,
26
){}
27
28
public
function
getTime() : ?Time{
return
$this->time; }
29
30
public
function
getColor() : ?
Color
{
return
$this->color; }
31
32
public
static
function
read(
PacketSerializer
$in) :
self
{
33
$time = $in->
readOptional
(fn() => Time::read($in));
34
$color = $in->
readOptional
(fn() => Color::read($in));
35
return
new
self
(
36
$time,
37
$color
38
);
39
}
40
41
public
function
write(
PacketSerializer
$out) :
void
{
42
$out->
writeOptional
($this->time, fn(Time $v) => $v->write($out));
43
$out->
writeOptional
($this->color, fn(
Color
$v) => $v->write($out));
44
}
45
}
pocketmine\color\Color
Definition:
Color.php:29
pocketmine\network\mcpe\protocol\serializer\PacketSerializer
Definition:
bedrock-protocol/src/serializer/PacketSerializer.php:68
pocketmine\network\mcpe\protocol\serializer\PacketSerializer\writeOptional
writeOptional(mixed $value, \Closure $writer)
Definition:
bedrock-protocol/src/serializer/PacketSerializer.php:858
pocketmine\network\mcpe\protocol\serializer\PacketSerializer\readOptional
readOptional(\Closure $reader)
Definition:
bedrock-protocol/src/serializer/PacketSerializer.php:846
pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionColor
Definition:
CameraFadeInstructionColor.php:19
pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstruction
Definition:
CameraFadeInstruction.php:21
pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionTime
Definition:
CameraFadeInstructionTime.php:19
vendor
pocketmine
bedrock-protocol
src
types
camera
CameraFadeInstruction.php
Generated by
1.9.3