@@ 14-66 (lines=53) @@ | ||
11 | use pocketmine\Player; |
|
12 | use VectorNetworkProject\TheMix\game\corepvp\TeamManager; |
|
13 | ||
14 | class BlueTeamManager extends TeamManager |
|
15 | { |
|
16 | /** @var array $list */ |
|
17 | private static $list = []; |
|
18 | ||
19 | public static function addList(Player $player): void |
|
20 | { |
|
21 | if (!self::isJoined($player)) { |
|
22 | self::$list[$player->getName()] = $player->getName(); |
|
23 | } |
|
24 | } |
|
25 | ||
26 | /** |
|
27 | * @param Player $player |
|
28 | */ |
|
29 | public static function removeList(Player $player): void |
|
30 | { |
|
31 | if (self::isJoined($player)) { |
|
32 | unset(self::$list[$player->getName()]); |
|
33 | } |
|
34 | } |
|
35 | ||
36 | /** |
|
37 | * @param Player $player |
|
38 | * |
|
39 | * @return bool |
|
40 | */ |
|
41 | public static function isJoined(Player $player): bool |
|
42 | { |
|
43 | return isset(self::$list[$player->getName()]) ? true : false; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @return array |
|
48 | */ |
|
49 | public static function getList(): array |
|
50 | { |
|
51 | return self::$list; |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @return int |
|
56 | */ |
|
57 | public static function getListCount(): int |
|
58 | { |
|
59 | return count(self::$list); |
|
60 | } |
|
61 | ||
62 | public static function ClearList(): void |
|
63 | { |
|
64 | self::$list = []; |
|
65 | } |
|
66 | } |
|
67 |
@@ 14-69 (lines=56) @@ | ||
11 | use pocketmine\Player; |
|
12 | use VectorNetworkProject\TheMix\game\corepvp\TeamManager; |
|
13 | ||
14 | class RedTeamManager extends TeamManager |
|
15 | { |
|
16 | /** @var array $list */ |
|
17 | private static $list = []; |
|
18 | ||
19 | public static function addList(Player $player): void |
|
20 | { |
|
21 | if (!self::isJoined($player)) { |
|
22 | self::$list[$player->getName()] = $player->getName(); |
|
23 | } |
|
24 | } |
|
25 | ||
26 | /** |
|
27 | * @param Player $player |
|
28 | */ |
|
29 | public static function removeList(Player $player): void |
|
30 | { |
|
31 | if (self::isJoined($player)) { |
|
32 | unset(self::$list[$player->getName()]); |
|
33 | } |
|
34 | } |
|
35 | ||
36 | /** |
|
37 | * @param Player $player |
|
38 | * |
|
39 | * @return bool |
|
40 | */ |
|
41 | public static function isJoined(Player $player): bool |
|
42 | { |
|
43 | return isset(self::$list[$player->getName()]) ? true : false; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @return array |
|
48 | */ |
|
49 | public static function getList(): array |
|
50 | { |
|
51 | return self::$list; |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @return int |
|
56 | */ |
|
57 | public static function getListCount(): int |
|
58 | { |
|
59 | return count(self::$list); |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * @return void |
|
64 | */ |
|
65 | public static function ClearList(): void |
|
66 | { |
|
67 | self::$list = []; |
|
68 | } |
|
69 | } |
|
70 |