PocketMine-MP 5.44.3 git-327e8a1690982f1ac3634944d705ebad5d91f4ad
Loading...
Searching...
No Matches
PrimitiveShapeType.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\shape;
16
17use pocketmine\network\mcpe\protocol\types\PacketIntEnumTrait;
18
19enum PrimitiveShapeType : int{
20 use PacketIntEnumTrait;
21
22 case LINE = 0;
23 case BOX = 1;
24 case SPHERE = 2;
25 case CIRCLE = 3;
26 case TEXT = 4;
27 case ARROW = 5;
28 case CYLINDER = 6;
29 case PYRAMID = 7;
30 case ELLIPSOID = 8;
31 case CONE = 9;
32
33 public const PAYLOAD_TYPE_NONE = 0;
34 public const PAYLOAD_TYPE_ARROW = 1;
35 public const PAYLOAD_TYPE_TEXT = 2;
36 public const PAYLOAD_TYPE_BOX = 3;
37 public const PAYLOAD_TYPE_LINE = 4;
38 public const PAYLOAD_TYPE_CIRCLE_OR_SPHERE = 5;
39 public const PAYLOAD_TYPE_CYLINDER = 6;
40 public const PAYLOAD_TYPE_PYRAMID = 7;
41 public const PAYLOAD_TYPE_ELLIPSOID = 8;
42 public const PAYLOAD_TYPE_CONE = 9;
43
47 public function getPayloadType() : int{
48 return match($this){
49 self::ARROW => self::PAYLOAD_TYPE_ARROW,
50 self::TEXT => self::PAYLOAD_TYPE_TEXT,
51 self::BOX => self::PAYLOAD_TYPE_BOX,
52 self::LINE => self::PAYLOAD_TYPE_LINE,
53 self::CIRCLE, self::SPHERE => self::PAYLOAD_TYPE_CIRCLE_OR_SPHERE,
54 self::CYLINDER => self::PAYLOAD_TYPE_CYLINDER,
55 self::PYRAMID => self::PAYLOAD_TYPE_PYRAMID,
56 self::ELLIPSOID => self::PAYLOAD_TYPE_ELLIPSOID,
57 self::CONE => self::PAYLOAD_TYPE_CONE,
58 };
59 }
60}