GameWinEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 4 1
1
<?php
2
/**
3
 * Copyright (c) 2018 VectorNetworkProject. All rights reserved. MIT license.
4
 *
5
 * GitHub: https://github.com/VectorNetworkProject/TheMix
6
 * Website: https://www.vector-network.tk
7
 */
8
9
namespace VectorNetworkProject\TheMix\game\event\game;
10
11
use pocketmine\event\Cancellable;
12
use pocketmine\event\player\PlayerEvent;
13
use pocketmine\Player;
14
15
class GameWinEvent extends PlayerEvent implements Cancellable
16
{
17
    /** @var int */
18
    public const WIN_RED = 0;
19
20
    /** @var int */
21
    public const WIN_BLUE = 1;
22
23
    /** @var int $type */
24
    private $type;
25
26
    /**
27
     * GameWinEvent constructor.
28
     *
29
     * @param int    $type
30
     * @param Player $player
31
     */
32
    public function __construct(int $type, Player $player)
33
    {
34
        $this->type = $type;
35
        $this->player = $player;
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function getType(): int
42
    {
43
        return $this->type;
44
    }
45
}
46