solved merge conflicts
parent
214dc0e286
commit
f140fb5905
|
|
@ -1,6 +1,23 @@
|
||||||
package de.hs_mannheim.informatik.pr2projekt.domain;
|
package de.hs_mannheim.informatik.pr2projekt.domain;
|
||||||
|
|
||||||
public class HitoriMain extends JFrame implements AcrtionListener{
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Scanner;
|
||||||
|
import java.util.Stack;
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
|
||||||
|
import de.hs_mannheim.informatik.pr2projekt.gui.GameGUI;
|
||||||
|
import de.hs_mannheim.informatik.pr2projekt.gui.MenuGUI;
|
||||||
|
|
||||||
|
public class HitoriMain extends JFrame implements ActionListener{
|
||||||
|
|
||||||
private static String[] filepath = new String[2];
|
private static String[] filepath = new String[2];
|
||||||
|
|
||||||
|
|
@ -20,7 +37,7 @@ public class HitoriMain extends JFrame implements AcrtionListener{
|
||||||
String[][] data = getData(filepath[0], Integer.parseInt(filepath[1]));
|
String[][] data = getData(filepath[0], Integer.parseInt(filepath[1]));
|
||||||
String[][] colors = makeColorArray(data.length);
|
String[][] colors = makeColorArray(data.length);
|
||||||
JButton[][] buttons = makeButtonArray(data);
|
JButton[][] buttons = makeButtonArray(data);
|
||||||
GameGUI.paintGame(buttons, colors, madeMoves, data);
|
GameGUI.paintGame(filepath, buttons, colors, madeMoves, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<String> readFromFile(String path){
|
public static ArrayList<String> readFromFile(String path){
|
||||||
|
|
@ -111,7 +128,7 @@ public class HitoriMain extends JFrame implements AcrtionListener{
|
||||||
buttons[i][j] = null;
|
buttons[i][j] = null;
|
||||||
}
|
}
|
||||||
JButton[][] buttons0 = makeButtonArray(data);
|
JButton[][] buttons0 = makeButtonArray(data);
|
||||||
GameGUI.paintGame(buttons0, colors, madeMoves, data);
|
GameGUI.paintGame(filepath, buttons0, colors, madeMoves, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,4 +188,10 @@ public class HitoriMain extends JFrame implements AcrtionListener{
|
||||||
}
|
}
|
||||||
return ergebnis;
|
return ergebnis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class GameGUI {
|
||||||
MenuGUI.getPath(filepath);
|
MenuGUI.getPath(filepath);
|
||||||
});
|
});
|
||||||
JButton b1 = new JButton("Zurück");
|
JButton b1 = new JButton("Zurück");
|
||||||
b1.addActionListener(e -> {HitoriMain.backOneStep(madeMoves, buttons, colors, gameGrid);});
|
b1.addActionListener(e -> {GameGUI.backOneStep(madeMoves, buttons, colors, gameGrid);});
|
||||||
JButton b2 = new JButton("Zurücksetzen");
|
JButton b2 = new JButton("Zurücksetzen");
|
||||||
b2.addActionListener(e -> {HitoriMain.totalResetButton(buttons, colors, madeMoves, data);});
|
b2.addActionListener(e -> {HitoriMain.totalResetButton(buttons, colors, madeMoves, data);});
|
||||||
JButton b3 = new JButton("Abgeben");
|
JButton b3 = new JButton("Abgeben");
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class HighscoreGUI {
|
||||||
"Hitori_Highscores/Hitori10x10medium.txt",
|
"Hitori_Highscores/Hitori10x10medium.txt",
|
||||||
"Hitori_Highscores/Hitori15x15_medium.txt"
|
"Hitori_Highscores/Hitori15x15_medium.txt"
|
||||||
};
|
};
|
||||||
HighscoreGUI.showHighscores(paths[j]);
|
HighscoreGUI.showHighscores(filepath, paths[j]);
|
||||||
frame.dispose();
|
frame.dispose();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,9 @@
|
||||||
package de.hs_mannheim.informatik.pr2projekt.gui;
|
package de.hs_mannheim.informatik.pr2projekt.gui;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
public class MenuGUI {
|
|
||||||
//ABC
|
|
||||||
=======
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.GridLayout;
|
import java.awt.GridLayout;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
|
|
@ -67,5 +62,4 @@ public class MenuGUI {
|
||||||
frame.setDefaultCloseOperation(0);
|
frame.setDefaultCloseOperation(0);
|
||||||
frame.add(menuPanel);
|
frame.add(menuPanel);
|
||||||
}
|
}
|
||||||
>>>>>>> refs/heads/gui
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue