forked from wille/relayawards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguard_probability.php
66 lines (47 loc) · 1.43 KB
/
guard_probability.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require_once "abstract_level.php";
abstract class GuardProbability extends AbstractLevelAward {
public function get_name() {
return "Guard Probability " . $this->level;
}
public function get_icon() {
return $this->king ? "king.png" : "guard_prob_" . $this->level . ".png";
}
public function get_description() {
return "Over " . $this->fraction . "% mean guard probability";
}
public function is_granted($relay) {
return $relay->guard_probability * 100 >= $this->fraction;
}
}
class GuardProbability1 extends GuardProbability {
public function __construct() {
parent::__construct(1, 0.001, 1);
}
}
class GuardProbability2 extends GuardProbability {
public function __construct() {
parent::__construct(2, 0.01, 2);
}
}
class GuardProbability3 extends GuardProbability {
public function __construct() {
parent::__construct(3, 0.1, 5);
}
}
class GuardProbability4 extends GuardProbability {
public function __construct() {
parent::__construct(4, 0.5, 10);
}
}
class GuardProbability5 extends GuardProbability {
public function __construct() {
parent::__construct(5, 1, 20);
}
}
class GuardProbability6 extends GuardProbability {
public function __construct() {
parent::__construct(6, 2, 30, true);
}
}
?>