Build world campaigns rewards and recaps
This commit is contained in:
60
app/Enums/WorldRewardType.php
Normal file
60
app/Enums/WorldRewardType.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum WorldRewardType: string
|
||||
{
|
||||
case Participant = 'participant';
|
||||
case Featured = 'featured';
|
||||
case Finalist = 'finalist';
|
||||
case Winner = 'winner';
|
||||
case Spotlight = 'spotlight';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Participant => 'Participant',
|
||||
self::Featured => 'Featured',
|
||||
self::Finalist => 'Finalist',
|
||||
self::Winner => 'Winner',
|
||||
self::Spotlight => 'Spotlight',
|
||||
};
|
||||
}
|
||||
|
||||
public function tone(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Participant => 'sky',
|
||||
self::Featured => 'amber',
|
||||
self::Finalist => 'violet',
|
||||
self::Winner => 'emerald',
|
||||
self::Spotlight => 'rose',
|
||||
};
|
||||
}
|
||||
|
||||
public function source(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Participant, self::Featured => 'automatic',
|
||||
self::Finalist, self::Winner, self::Spotlight => 'manual',
|
||||
};
|
||||
}
|
||||
|
||||
public function isAutomatic(): bool
|
||||
{
|
||||
return $this->source() === 'automatic';
|
||||
}
|
||||
|
||||
public function xpReward(): int
|
||||
{
|
||||
return match ($this) {
|
||||
self::Participant => 20,
|
||||
self::Featured => 40,
|
||||
self::Finalist => 70,
|
||||
self::Winner => 120,
|
||||
self::Spotlight => 55,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user