using System.Linq;
using Godot;
using Godot.Collections;

namespace Game.Resources;

[GlobalClass]
public partial class MeetingResource : Resource
{
    [Export]
    public Array<MeetingActionResource> OnMeetingStartActions { get; set; } = [];

    [Export]
    public Array<MeetingActionResource> OnMeetingEndActions { get; set; } = [];

    [Export]
    public string Title { get; set; }

    [Export]
    public Color Color { get; set; }

    public void StartMeeting(GameState gameState)
    {
        OnMeetingStartActions.ToList().ForEach(m => m.Execute(gameState));
    }

    public void EndMeeting(GameState gameState)
    {
        OnMeetingEndActions.ToList().ForEach(m => m.Execute(gameState));
    }
}

public partial class DummyMeetingResource : MeetingResource
{
    public DummyMeetingResource()
    {
        Title = "Dummy Meeting";
        Color = Colors.Magenta;
    }
}
