Skip to content

Commit

Permalink
1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
niangaonb committed Dec 18, 2022
1 parent 3c14af0 commit 34932cb
Show file tree
Hide file tree
Showing 33 changed files with 107 additions and 105 deletions.
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ tasks.withType(JavaCompile).configureEach {
}

application {
mainModule = 'com.niangaoa.YingYe'
mainClass = 'com.niangaoa.YingYe.YingYeMain'
mainModule = 'com.niangaoa.BusinessSimulator'
mainClass = 'com.niangaoa.BusinessSimulator.BSSMain'
}

javafx {
Expand Down Expand Up @@ -53,18 +53,20 @@ test {
}

jlink {
imageZip = project.file("build/app/sb.zip") as RegularFile
imageZip = project.file("build/Business Simulator/Business Simulator.zip") as RegularFile
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'app'
name = 'Business Simulator'
}

jpackage {
jvmArgs = ['-splash:$APPDIR/splash.png']
def currentOs = org.gradle.internal.os.OperatingSystem.current()
def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png'
icon = "icon.$imgType"
// imageOptions += ['--win-console']
vendor = "niangaoa"
appVersion = "1.0"
imageOptions += ['--win-console']
installerOptions += [
'--vendor', 'Acme Corporation',
'--file-associations', 'src/main/resources/associations.properties',
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = "YingYe"
rootProject.name = "BusinessSimulator"
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package com.niangaoa.YingYe.App;
package com.niangaoa.BusinessSimulator.App;

import com.niangaoa.YingYe.YingYeMain;
import com.niangaoa.BusinessSimulator.BSSMain;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class YingYeAnnouncement extends Application {
public class BSSAnnouncement extends Application {
@Override
public void start(Stage announcementStage) throws Exception {
//导入FXML
FXMLLoader yingYeAnnouncementFXML = new FXMLLoader(YingYeMain.class.getResource("Fxml/YingYeAnnouncement.fxml"));
FXMLLoader yingYeAnnouncementFXML = new FXMLLoader(BSSMain.class.getResource("Fxml/BSSAnnouncement.fxml"));
//设置显示
Scene scene = new Scene(yingYeAnnouncementFXML.load());
announcementStage.setResizable(false);
//设置标题
announcementStage.setTitle("营业模拟器");
//设置Icon
announcementStage.getIcons().add(new Image(String.valueOf(YingYeMain.class.getResource("Img/icon.png"))));
announcementStage.getIcons().add(new Image(String.valueOf(BSSMain.class.getResource("Img/icon.png"))));
announcementStage.setScene(scene);
announcementStage.show();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.niangaoa.YingYe.App;
package com.niangaoa.BusinessSimulator.App;

import com.niangaoa.YingYe.YingYeMain;
import com.niangaoa.BusinessSimulator.BSSMain;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
Expand All @@ -9,18 +9,18 @@
import org.kordamp.bootstrapfx.BootstrapFX;


public class YingYeGame extends Application {
public class BSSGame extends Application {
@Override
public void start(Stage gameStage) throws Exception {
//导入FXML
FXMLLoader yingYeMainFXML = new FXMLLoader(YingYeMain.class.getResource("Fxml/YingYeGame.fxml"));
FXMLLoader yingYeMainFXML = new FXMLLoader(BSSMain.class.getResource("Fxml/BSSGame.fxml"));
//设置显示
Scene scene = new Scene(yingYeMainFXML.load());
//设置标题
gameStage.setTitle("营业模拟器");
gameStage.setResizable(Boolean.FALSE);
//设置Icon
gameStage.getIcons().add(new Image(String.valueOf(YingYeMain.class.getResource("Img/icon.png"))));
gameStage.getIcons().add(new Image(String.valueOf(BSSMain.class.getResource("Img/icon.png"))));
gameStage.setScene(scene);
scene.getStylesheets().add(BootstrapFX.bootstrapFXStylesheet());
gameStage.show();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.niangaoa.YingYe.App;
import com.niangaoa.YingYe.YingYeMain;
package com.niangaoa.BusinessSimulator.App;
import com.niangaoa.BusinessSimulator.BSSMain;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
Expand All @@ -8,18 +8,18 @@

import java.io.IOException;

public class YingYeMap extends Application {
public class BSSMap extends Application {
@Override
public void start(Stage mapStage) throws IOException {
//导入FXML
FXMLLoader yingYeAnnouncementFXML = new FXMLLoader(YingYeMain.class.getResource("Fxml/YingYeMap.fxml"));
FXMLLoader yingYeAnnouncementFXML = new FXMLLoader(BSSMain.class.getResource("Fxml/BSSMap.fxml"));
//设置显示
Scene scene = new Scene(yingYeAnnouncementFXML.load());
mapStage.setResizable(false);
//设置标题
mapStage.setTitle("营业模拟器");
//设置Icon
mapStage.getIcons().add(new Image(String.valueOf(YingYeMain.class.getResource("Img/icon.png"))));
mapStage.getIcons().add(new Image(String.valueOf(BSSMain.class.getResource("Img/icon.png"))));
mapStage.setScene(scene);
mapStage.show();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package com.niangaoa.YingYe.App;
package com.niangaoa.BusinessSimulator.App;

import com.niangaoa.YingYe.YingYeMain;
import com.niangaoa.BusinessSimulator.BSSMain;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class YingYeMenu extends Application {
public class BSSMenu extends Application {
@Override
public void start(Stage menuStage) throws Exception {
//导入FXML
FXMLLoader yingYeAnnouncementFXML = new FXMLLoader(YingYeMain.class.getResource("Fxml/YingYeMenu.fxml"));
FXMLLoader yingYeAnnouncementFXML = new FXMLLoader(BSSMain.class.getResource("Fxml/BSSMenu.fxml"));
//设置显示
Scene scene = new Scene(yingYeAnnouncementFXML.load());
menuStage.setResizable(false);
//设置标题
menuStage.setTitle("营业模拟器");
//设置Icon
menuStage.getIcons().add(new Image(String.valueOf(YingYeMain.class.getResource("Img/icon.png"))));
menuStage.getIcons().add(new Image(String.valueOf(BSSMain.class.getResource("Img/icon.png"))));
menuStage.setScene(scene);
menuStage.show();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.niangaoa.YingYe.App;
package com.niangaoa.BusinessSimulator.App;

import com.niangaoa.YingYe.YingYeMain;
import com.niangaoa.BusinessSimulator.BSSMain;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
Expand All @@ -9,15 +9,15 @@

import java.io.IOException;

public class YingYeMessage extends Application {
public class BSSMessage extends Application {
@Override
public void start(Stage messageStage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(YingYeMain.class.getResource("Fxml/YingYeMessage.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(BSSMain.class.getResource("Fxml/BSSMessage.fxml"));
Scene scene = new Scene(fxmlLoader.load());
messageStage.setResizable(false);
messageStage.setScene(scene);
messageStage.setTitle("营业模拟器");
messageStage.getIcons().add(new Image(String.valueOf(YingYeMain.class.getResource("Img/icon.png"))));
messageStage.getIcons().add(new Image(String.valueOf(BSSMain.class.getResource("Img/icon.png"))));
messageStage.show();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.niangaoa.YingYe.App;
package com.niangaoa.BusinessSimulator.App;

import com.niangaoa.YingYe.YingYeMain;
import com.niangaoa.BusinessSimulator.BSSMain;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
Expand All @@ -9,19 +9,19 @@

import java.io.IOException;

public class YingYeTutorial extends Application {
public class BSSTutorial extends Application {
@Override
public void start(Stage tutorialStage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(YingYeMain.class.getResource("Fxml/YingYeTutorial.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(BSSMain.class.getResource("Fxml/BSSTutorial.fxml"));
Scene scene = new Scene(fxmlLoader.load());
tutorialStage.setResizable(false);
tutorialStage.setScene(scene);
tutorialStage.setTitle("营业模拟器");
tutorialStage.getIcons().add(new Image(String.valueOf(YingYeMain.class.getResource("Img/icon.png"))));
tutorialStage.getIcons().add(new Image(String.valueOf(BSSMain.class.getResource("Img/icon.png"))));
tutorialStage.show();
tutorialStage.setOnCloseRequest(event -> {
try {
new YingYeMenu().start(new Stage());
new BSSMenu().start(new Stage());
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/niangaoa/BusinessSimulator/BSSMain.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.niangaoa.BusinessSimulator;

import com.niangaoa.BusinessSimulator.App.BSSAnnouncement;
import javafx.application.Application;
import javafx.stage.Stage;

public class BSSMain extends Application {
@Override
public void start(Stage mainStage) throws Exception {
mainStage.hide();
new BSSAnnouncement().start(new Stage());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.niangaoa.YingYe.Ctrller;
package com.niangaoa.BusinessSimulator.Ctrller;

import com.niangaoa.YingYe.App.YingYeMenu;
import com.niangaoa.BusinessSimulator.App.BSSMenu;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
Expand All @@ -11,7 +11,7 @@
import java.net.URL;
import java.util.ResourceBundle;

public class YingYeAnnouncementCtrl implements Initializable {
public class BSSAnnouncementCtrl implements Initializable {
@FXML
private Button Next1 = new Button();

Expand All @@ -22,7 +22,7 @@ public class YingYeAnnouncementCtrl implements Initializable {
private void onChick() throws Exception {
Stage stage = (Stage)Next1.getScene().getWindow();
stage.close();
new YingYeMenu().start(new Stage());
new BSSMenu().start(new Stage());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.niangaoa.YingYe.Ctrller;
package com.niangaoa.BusinessSimulator.Ctrller;


import com.niangaoa.YingYe.App.YingYeMap;
import com.niangaoa.YingYe.GameContro.BuySell;
import com.niangaoa.YingYe.GameContro.GameData;
import com.niangaoa.BusinessSimulator.App.BSSMap;
import com.niangaoa.BusinessSimulator.GameContro.BuySell;
import com.niangaoa.BusinessSimulator.GameContro.GameData;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
Expand All @@ -16,7 +16,7 @@
import java.net.URL;
import java.util.ResourceBundle;

public class YingYeGameCtrl implements Initializable {
public class BSSGameCtrl implements Initializable {
@FXML
public Text honor = new Text();
@FXML
Expand Down Expand Up @@ -152,13 +152,13 @@ public class YingYeGameCtrl implements Initializable {
public GameData gameData = new GameData();


public YingYeGameCtrl() {
public BSSGameCtrl() {
}


@FXML
private void onMapChick() throws IOException {
new YingYeMap().start(new Stage());
new BSSMap().start(new Stage());
}

@FXML
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.niangaoa.BusinessSimulator.Ctrller;

public class BSSMapCtrl {
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.niangaoa.YingYe.Ctrller;
package com.niangaoa.BusinessSimulator.Ctrller;

import com.niangaoa.YingYe.App.YingYeGame;
import com.niangaoa.YingYe.App.YingYeTutorial;
import com.niangaoa.BusinessSimulator.App.BSSGame;
import com.niangaoa.BusinessSimulator.App.BSSTutorial;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.stage.Stage;

import java.io.IOException;

public class YingYeMenuCtrl {
public class BSSMenuCtrl {
@FXML
public Button Tutorial = new Button();

Expand All @@ -28,13 +28,13 @@ private void onExit() {
private void onStart() throws Exception {
Stage stage = (Stage) Start1.getScene().getWindow();
stage.close();
new YingYeGame().start(new Stage());
new BSSGame().start(new Stage());
}

@FXML
private void onTutorial() throws IOException {
Stage stage = (Stage) Start1.getScene().getWindow();
stage.close();
new YingYeTutorial().start(new Stage());
new BSSTutorial().start(new Stage());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.niangaoa.YingYe.Ctrller;
package com.niangaoa.BusinessSimulator.Ctrller;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
Expand All @@ -8,7 +8,7 @@
import java.net.URL;
import java.util.ResourceBundle;

public class YingYeMessageCtrl implements Initializable {
public class BSSMessageCtrl implements Initializable {
@FXML
public Text message1 = new Text();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.niangaoa.YingYe.Ctrller;
package com.niangaoa.BusinessSimulator.Ctrller;

import com.niangaoa.YingYe.App.YingYeMenu;
import com.niangaoa.BusinessSimulator.App.BSSMenu;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class YingYeTutorialCtrl {
public class BSSTutorialCtrl {
@FXML
private Button back;

@FXML
private void onBack() throws Exception {
Stage stage = (Stage) back.getScene().getWindow();
stage.close();
new YingYeMenu().start(new Stage());
new BSSMenu().start(new Stage());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.niangaoa.YingYe.GameContro;
package com.niangaoa.BusinessSimulator.GameContro;

import javafx.scene.text.Text;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.niangaoa.BusinessSimulator.GameContro;

import com.niangaoa.BusinessSimulator.Ctrller.BSSGameCtrl;

public class DataSave {
public static void main(String[] args) {
BSSGameCtrl BSSGameCtrl = new BSSGameCtrl();
BSSGameCtrl.addTextToArray();
System.out.println(BSSGameCtrl.gameData.gameDataList.get(0));
}
}
Loading

0 comments on commit 34932cb

Please sign in to comment.