package com.ghost.technic;

import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;

public class BattlefieldView extends Table {
    public BattlefieldView(Skin skin) {
        super(skin);
        setFillParent(true);

        // Top rows — opponent side
        Table opponentZones = new Table(skin);
//        opponentZones.align(Align.left);
        opponentZones.add(new Label("Archives", skin)).pad(5);
        opponentZones.add(new Label("Discard", skin)).pad(5);
        opponentZones.add().expandX(); // spacer
        opponentZones.add(new Label("Archon", skin)).pad(5);
        opponentZones.add(new Label("Deck", skin)).pad(5).right();

        Table opponentArtifacts = new Table(skin);
        opponentArtifacts.add(new Label("Opponent Artifacts", skin)).pad(10);

        Table opponentCreatures = new Table(skin);
        opponentCreatures.add(new Label("Opponent Creatures", skin)).pad(10);

        Table yourCreatures = new Table(skin);
        yourCreatures.add(new Label("Your Creatures", skin)).pad(10);

        Table yourArtifacts = new Table(skin);
        yourArtifacts.add(new Label("Your Artifacts", skin)).pad(10);

        Table yourZones = new Table(skin);
//        yourZones.align(Align.left);
        yourZones.add(new Label("Deck", skin)).pad(5);
        yourZones.add(new Label("Archon", skin)).pad(5);
        yourZones.add().expandX(); // spacer
        yourZones.add(new Label("Discard", skin)).pad(5);
        yourZones.add(new Label("Archives", skin)).pad(5).right();

        // Misc vertical zone (Tide, Prophecy, Tokens, etc.)
        Table miscZone = new Table(skin);
        miscZone.top().right();
        miscZone.add(new Label("Misc Zone", skin)).pad(10).row();
        miscZone.add(new Label("[Tide]", skin)).pad(5).row();
        miscZone.add(new Label("[Prophecy]", skin)).pad(5).row();
        miscZone.add(new Label("[Tokens]", skin)).pad(5);

        // Layout main table with a center content + misc column on right
        Table mainCenter = new Table(skin);
        mainCenter.add(opponentZones).expand().fill().row();
        mainCenter.add(opponentArtifacts).expand().fill().row();
        mainCenter.add(opponentCreatures).expand().fill().row();
        mainCenter.add(yourCreatures).expand().fill().row();
        mainCenter.add(yourArtifacts).expand().fill().row();
        mainCenter.add(yourZones).expand().fill().row();;

        // Add main and misc to the root table
        this.add(mainCenter).expand().fill().left();
        this.add(miscZone).right().padRight(20f);
    }
}
