|
@@ -1,24 +1,27 @@
|
|
import javax.swing.*;
|
|
import javax.swing.*;
|
|
import java.awt.*;
|
|
import java.awt.*;
|
|
|
|
+import java.awt.event.WindowAdapter;
|
|
|
|
+import java.awt.event.WindowEvent;
|
|
|
|
+import java.io.*;
|
|
|
|
+import java.lang.Throwable;
|
|
|
|
|
|
public class Main
|
|
public class Main
|
|
{
|
|
{
|
|
|
|
+ public static Model model;
|
|
|
|
+
|
|
public static void main(String[] args)
|
|
public static void main(String[] args)
|
|
{
|
|
{
|
|
JFrame window = new JFrame("Fotag!");
|
|
JFrame window = new JFrame("Fotag!");
|
|
- Model model;
|
|
|
|
|
|
+ model = new Model();
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
FileInputStream file = new FileInputStream("savestate.shit");
|
|
FileInputStream file = new FileInputStream("savestate.shit");
|
|
ObjectInputStream object = new ObjectInputStream(file);
|
|
ObjectInputStream object = new ObjectInputStream(file);
|
|
- model = object.readObject();
|
|
|
|
|
|
+ model = (Model)object.readObject();
|
|
object.close();
|
|
object.close();
|
|
}
|
|
}
|
|
- catch
|
|
|
|
- {
|
|
|
|
- model = new Model();
|
|
|
|
- }
|
|
|
|
|
|
+ catch (Exception e) {System.out.println("Playing baseball");}
|
|
|
|
|
|
Gallery gallery = new Gallery(model);
|
|
Gallery gallery = new Gallery(model);
|
|
Controls controls = new Controls(model);
|
|
Controls controls = new Controls(model);
|
|
@@ -51,11 +54,14 @@ public class Main
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- FileOutputStream file = new FileOutputStream("savestate.shit");
|
|
|
|
- ObjectOutputStream object = new ObjectOutputStream(file);
|
|
|
|
- object.writeObject(model);
|
|
|
|
- object.close();
|
|
|
|
- } catch(Exception e) {System.out.println("Screw you ankil");}
|
|
|
|
|
|
+ ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream("savestate.shit"));
|
|
|
|
+ output.writeObject(model);
|
|
|
|
+ output.close();
|
|
|
|
+ } catch (Exception e)
|
|
|
|
+ {
|
|
|
|
+ System.out.println("Screw you ankil");
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
System.exit(0);
|
|
System.exit(0);
|