PlayerBountyEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getGold() 0 4 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\player;
10
11
use pocketmine\event\Cancellable;
12
use pocketmine\event\player\PlayerEvent;
13
use pocketmine\Player;
14
15
class PlayerBountyEvent extends PlayerEvent implements Cancellable
16
{
17
    public const ENABLE_BOUNTY = 0;
18
    public const PLUS_GOLD = 1;
19
20
    /* @var int $gold */
21
    private $gold;
22
23
    /* @var int $bounty */
24
    private $bounty;
25
26
    /**
27
     * PlayerBountyEvent constructor.
28
     *
29
     * @param Player $player
30
     * @param int    $gold
31
     * @param int    $bounty
32
     */
33
    public function __construct(Player $player, int $gold, int $bounty)
34
    {
35
        $this->player = $player;
36
        $this->gold = $gold;
37
        $this->bounty = $bounty;
38
    }
39
40
    /**
41
     * @return int
42
     */
43
    public function getGold(): int
44
    {
45
        return $this->gold;
46
    }
47
48
    /**
49
     * @return int
50
     */
51
    public function getType(): int
52
    {
53
        return $this->bounty;
54
    }
55
}
56