Skip to content

Commit

Permalink
Updates:
Browse files Browse the repository at this point in the history
1.now you will create tables if they not exist + add launcher sql work
  • Loading branch information
GalKarp committed Oct 1, 2014
1 parent 0ea46d6 commit 729e764
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 157 deletions.
2 changes: 1 addition & 1 deletion Java-Missle/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="forms-1.3.0.jar" sourcepath="forms-1.3.0-src.zip"/>
<classpathentry kind="lib" path="C:/Users/Andrey/Desktop/mysql-connector-java-5.1.18-bin.jar"/>
<classpathentry kind="lib" path="C:/Users/DELL-PC/git/Java-Missle/Java-Missle/mysql-connector-java-5.1.33-bin.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
11 changes: 2 additions & 9 deletions Java-Missle/src/main/Program.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
package main;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.Scanner;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.xml.parsers.ParserConfigurationException;

import launcher.Destructor;
import launcher.Launcher;
import missile.AbstractMissile;
import missile.DestructedLanucher;
import missile.DestructedMissile;
import missile.Missile;

import org.xml.sax.SAXException;

import view.WarGui;
import war.War;
import war.WarUtility;
import war.controller.AbstractWarView;
import war.controller.WarController;
import war.db.WarDBConnection;
Expand All @@ -37,7 +29,8 @@ public static void main(String[] args) {

try {
// War warModel = xml.readXML();
WarDBConnection.clearWarDataBase();
new WarDBConnection();
// WarDBConnection.clearWarDataBase();
War warModel = new War();
AbstractWarView viewGui = new WarGui();

Expand Down
4 changes: 4 additions & 0 deletions Java-Missle/src/war/War.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import war.controller.WarController;
import war.controller.WarEventListener;
import war.db.WarDBConnection;


/**
Expand Down Expand Up @@ -175,6 +176,8 @@ public void addLauncher(String id) throws Exception {
}
boolean is_hidden = (Math.round(Math.random()) == 1) ? true : false;
addLauncher(new Launcher(id, is_hidden , listeners));
int stat = (is_hidden == true) ? 1 : 0;
WarDBConnection.addNewLauncher(id, stat);
}


Expand Down Expand Up @@ -202,6 +205,7 @@ public void addMissile(String name, String dest, String damage,
for(Launcher launcher : missileLaunchers){
if(launcherId.equalsIgnoreCase(launcher.getLauncherId())){
launcher.addMissile(name, dest, 0, flyTimeInt, damageInt);
WarDBConnection.addNewMissile(name, dest, damageInt, flyTimeInt, "wait");
}
}
}
Expand Down
Loading

0 comments on commit 729e764

Please sign in to comment.