Finished Progression Overview with edit fields in user details page.

This commit is contained in:
Vari
2024-03-26 23:20:46 +01:00
parent 139c1f0b47
commit dee1cfc19d
7 changed files with 104 additions and 11 deletions

View 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');
}
}