Skip to content

Commit

Permalink
fix: add support for "Alpha Zombies" (#1558)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches authored Jan 7, 2025
1 parent 07623f1 commit b783f31
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Support/Gametype/GametypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ public static function findBaseGametype(string $name): BaseGametype
return BaseGametype::MINI_GAME();
}

$infectionGameModes = [
'Zombies',
];

if (Str::contains($name, $infectionGameModes, true)) {
return BaseGametype::INFECTION();
}

throw new \InvalidArgumentException("Unable to find base gametype for: {$name}");
}
}
9 changes: 9 additions & 0 deletions tests/Feature/Console/RefreshOverviewsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public function test_valid_generation_of_overviews(): void
'name' => 'Ninjanaut',
]);

$alphaZombies = Gamevariant::factory()->createOne([
'name' => 'Alpha Zombies',
]);

$map1 = Map::factory()->createOne([
'name' => 'Absolute',
'level_id' => $level->id,
Expand Down Expand Up @@ -107,6 +111,11 @@ public function test_valid_generation_of_overviews(): void
'gamevariant_id' => $ninjaNaut->id,
]);

Game::factory()->createOne([
'map_id' => $map1->id,
'gamevariant_id' => $alphaZombies->id,
]);

// Act
$this->artisan('analytics:overviews:refresh')
->expectsOutputToContain('Processed '.$game->map->name)
Expand Down

0 comments on commit b783f31

Please sign in to comment.