<?php

namespace App\Models;

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

class PlayerGameRole extends Model
{
    protected $fillable = [
        'player_game_profile_id',
        'game_role_id',
        'is_primary',
    ];

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

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

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