Files
BUT3ProjetJeuGroupe/fr/iut_fbleau/Avalam/AvalamWindow.java

43 lines
1.1 KiB
Java

package fr.iut_fbleau.Avalam;
import fr.iut_fbleau.Avalam.logic.*;
import fr.iut_fbleau.Avalam.ui.*;
import javax.swing.*;
import java.awt.*;
/**
* Fenêtre principale du jeu Avalam.
*/
public class AvalamWindow extends JFrame {
public AvalamWindow() {
super("Avalam - Plateau Graphique");
setSize(750, 800);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Tower[][] grid = BoardLoader.loadFromFile("fr/iut_fbleau/Res/Plateau.txt");
GameState gs = new GameState(grid);
ScoreManager sm = new ScoreManager();
int y = sm.count(Color.COLOR1, grid);
int r = sm.count(Color.COLOR2, grid);
ScoreView scoreView = new ScoreView(y, r);
TurnView turnView = new TurnView("Tour du joueur : Jaune");
BoardView boardView = new BoardView(gs);
JPanel top = new JPanel(new GridLayout(2,1));
top.add(scoreView);
top.add(turnView);
add(top, BorderLayout.NORTH);
add(boardView, BorderLayout.CENTER);
setVisible(true);
}
}