using Godot;
using System;

public partial class ship_choice : CenterContainer
{
    public override void _Ready()
    {
        GetNode<Button>("VBox/ConfirmButton").Pressed += OnConfirmButtonPressed;
    }
    
    private void OnConfirmButtonPressed()
    {
        var colorIndex = GetNode<OptionButton>("VBox/HBox/ColorOption").Selected;
        var typeIndex = GetNode<OptionButton>("VBox/HBox/TypeOption").Selected;
        
        player_config.SelectedColor = (player.ShipColor)colorIndex;
        player_config.SelectedType = (ship.ShipType)typeIndex;
        
        //GD.Print("attempting start");
        
        GetTree().ChangeSceneToFile("res://scenes/system/game.tscn");
    }
    
}
