mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-09-12 13:15:26 -05:00
Finished Progression Overview with edit fields in user details page.
This commit is contained in:
34
dist/app/View/Components/Misc/Progression/CharacterProgression.php
vendored
Normal file
34
dist/app/View/Components/Misc/Progression/CharacterProgression.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Misc\Progression;
|
||||
|
||||
use App\Models\Game\CharacterData;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class CharacterProgression extends Component
|
||||
{
|
||||
public float $progress = 0;
|
||||
|
||||
public int $neededExperience;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct(
|
||||
public CharacterData $character,
|
||||
)
|
||||
{
|
||||
$this->neededExperience = CharacterData::getExperienceForLevel($character->level);
|
||||
$this->progress = (float)$character->experience / (float)$this->neededExperience ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.misc.progression.character-progression');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user