ArrayFilter::CountKey()
@@ -63,6 +63,7 @@ | ||
63 | 63 | //['user_no' => 14, RequestDataVote::TARGET => 18, 'type' => VoteAction::CHILD_FOX], |
64 | 64 | //['user_no' => 14, RequestDataVote::TARGET => 13, 'type' => VoteAction::VOODOO_KILLER], |
65 | 65 | //['user_no' => 14, RequestDataVote::TARGET => 5, 'type' => VoteAction::JAMMER], |
66 | + //['user_no' => 15, RequestDataVote::TARGET => 6, 'type' => VoteAction::POSSESSED], | |
66 | 67 | //['user_no' => 16, RequestDataVote::TARGET => '11 6 1 2 3 4 5', 'type' => VoteAction::STEP_MAGE], |
67 | 68 | //['user_no' => 17, RequestDataVote::TARGET => 22, 'type' => VoteAction::FAIRY], |
68 | 69 | //['user_no' => 18, RequestDataVote::TARGET => 20, 'type' => VoteAction::VOODOO_FOX], |
@@ -527,6 +527,11 @@ | ||
527 | 527 | return self::Concat($list, ','); |
528 | 528 | } |
529 | 529 | |
530 | + //カウント | |
531 | + public static function CountKey(array $list, $key = null) { | |
532 | + return count(self::GetKeyList($list, $key)); | |
533 | + } | |
534 | + | |
530 | 535 | /* 更新系 */ |
531 | 536 | //初期化 |
532 | 537 | public static function Initialize(array &$list, $target, $value = []) { |
@@ -7,11 +7,11 @@ | ||
7 | 7 | RoleLoader::LoadFile('priest'); |
8 | 8 | class Role_holy_priest extends Role_priest { |
9 | 9 | protected function IgnoreResult() { |
10 | - return ! DB::$ROOM->IsDate(5); | |
10 | + return false === DB::$ROOM->IsDate(5); | |
11 | 11 | } |
12 | 12 | |
13 | 13 | protected function IgnoreSetPriest() { |
14 | - return ! DB::$ROOM->IsDate(4); | |
14 | + return false === DB::$ROOM->IsDate(4); | |
15 | 15 | } |
16 | 16 | |
17 | 17 | protected function IsAggregatePriestCamp() { |
@@ -33,7 +33,7 @@ | ||
33 | 33 | } |
34 | 34 | //Text::p($stack, "◆Camp [{$this->role}]"); |
35 | 35 | |
36 | - DB::$ROOM->ResultAbility($result, count(array_keys($stack)), null, $user->id); | |
36 | + DB::$ROOM->ResultAbility($result, ArrayFilter::CountKey($stack), null, $user->id); | |
37 | 37 | } |
38 | 38 | } |
39 | 39 | } |
@@ -22,7 +22,7 @@ | ||
22 | 22 | |
23 | 23 | protected function OutputAddResult() { |
24 | 24 | RoleHTML::OutputPossessed(); |
25 | - if (! $this->IgnoreFilterVoteDo()) { | |
25 | + if (false === $this->IgnoreFilterVoteDo()) { | |
26 | 26 | RoleHTML::OutputAbilityResult('ability_possessed_mad', null); |
27 | 27 | } |
28 | 28 | } |
@@ -58,7 +58,7 @@ | ||
58 | 58 | } |
59 | 59 | |
60 | 60 | protected function IsVoteCheckboxLive($live) { |
61 | - return ! $live; | |
61 | + return false === $live; | |
62 | 62 | } |
63 | 63 | |
64 | 64 | protected function IgnoreVoteCheckboxDummyBoy() { |
@@ -66,7 +66,7 @@ | ||
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function IgnoreFinishVote() { |
69 | - return ! $this->IsAddVote(); | |
69 | + return false === $this->IsAddVote(); | |
70 | 70 | } |
71 | 71 | |
72 | 72 | //死者憑依情報セット |
@@ -80,7 +80,7 @@ | ||
80 | 80 | return false; |
81 | 81 | } elseif (RoleUser::LimitedPossessed($user)) { |
82 | 82 | return false; |
83 | - } elseif (! $user->IsSame($user->GetReal())) { | |
83 | + } elseif (false === $user->IsSame($user->GetReal())) { | |
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | $this->AddStack($user->id, 'possessed_dead'); |
@@ -95,7 +95,7 @@ | ||
95 | 95 | final public function SetPossessed() { |
96 | 96 | $stack = $this->GetStack('possessed_dead'); |
97 | 97 | foreach ($stack as $id => $target_id) { |
98 | - if (count(array_keys($stack, $target_id)) == 1) { //競合判定 | |
98 | + if (ArrayFilter::CountKey($stack, $target_id) == 1) { //競合判定 | |
99 | 99 | $this->AddStack($target_id, RoleVoteSuccess::POSSESSED, $id); |
100 | 100 | } |
101 | 101 | } |