// Copyright Sven-Olof Nystrom Uppsala University 2025

import java.awt.*;
import java.util.*;
import javax.swing.*;

class CardTest extends JPanel {
    // Draw some cards, just to check that image files are available
    // and Card class works.

    private static final int INDENT = 80;
    
    Card ace    = new Card(0,0);
    Card four   = new Card(1,3);
    Card knight = new Card(2,10);
    Card queen  = new Card(3,11);

    public CardTest () {
        setBackground( Color.GREEN );

        ace.flip(); knight.flip(); queen.flip();
        
        ace.move(INDENT,      INDENT);
        four.move(INDENT*2,   INDENT);
        knight.move(INDENT*3, INDENT);
        queen.move(INDENT*4,  INDENT);
    
    }

    public void paintComponent (Graphics g) {
        super.paintComponent(g);
        
        ace.draw(g);
        four.draw(g);
        knight.draw(g);
        queen.draw(g);
    }
    
    static public void main(String[] args) { 
        JPanel p = new CardTest();
        JFrame f = new JFrame();
        
        f.getContentPane().add(p);
                
	f.setBounds(100, 100, 800, 500);
        
        f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
        f.setVisible(true);

    }
}
    
