<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class PlayerGameCharacter extends Model
{
    protected $fillable = [
        'player_game_profile_id',
        'game_character_id',
        'sort_order',
    ];

    protected function casts(): array
    {
        return [
            'sort_order' => 'integer',
        ];
    }

    public function playerGameProfile(): BelongsTo
    {
        return $this->belongsTo(PlayerGameProfile::class);
    }

    public function gameCharacter(): BelongsTo
    {
        return $this->belongsTo(GameCharacter::class);
    }
}
