1 | <?php |
||
5 | class Common |
||
6 | { |
||
7 | /** |
||
8 | * Checks if the given string is a valid display name |
||
9 | * |
||
10 | * @param string $rsn |
||
11 | * @return bool |
||
12 | */ |
||
13 | 7 | public function validateDisplayName($rsn) |
|
17 | |||
18 | /** |
||
19 | * Expands a short-hand number to its full value |
||
20 | * |
||
21 | * @param string $number |
||
22 | * @return float |
||
23 | */ |
||
24 | 1 | public function expandNumber($number) |
|
42 | |||
43 | /** |
||
44 | * Compact a number into short-hand |
||
45 | * |
||
46 | * @param int $number |
||
47 | * @return string |
||
48 | */ |
||
49 | 1 | public function shortenNumber($number) |
|
61 | |||
62 | /** |
||
63 | * Calculate a level with the give amount of experience |
||
64 | * |
||
65 | * @param int $xp |
||
66 | * @return int |
||
67 | */ |
||
68 | 1 | public function xpTolevel($xp) |
|
84 | |||
85 | /** |
||
86 | * Calculates the minimum experience needed for the given level |
||
87 | * |
||
88 | * @param int $level |
||
89 | * @return int |
||
90 | */ |
||
91 | 1 | public function levelToXp($level) |
|
104 | } |
||
105 |