mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
add: some more languages
This commit is contained in:
17
.idea/resourceBundles.xml
generated
17
.idea/resourceBundles.xml
generated
@@ -1,11 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ResourceBundleManager">
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_Arabic.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_Georgian.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_Hindi.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_Japanese.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_Korean.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_Russian.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ar.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_de.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_en.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_es.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_fr.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_hi.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_it.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ja.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ka.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ko.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_nl.properties" />
|
||||
<file url="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_zh.properties" />
|
||||
<custom-resource-bundle>
|
||||
@@ -18,12 +29,18 @@
|
||||
<base-name>localization</base-name>
|
||||
</custom-resource-bundle>
|
||||
<custom-resource-bundle>
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ar.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_de.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_en.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_es.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_fr.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_hi.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_it.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ja.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ka.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ko.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_nl.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_ru.properties" />
|
||||
<file value="file://$PROJECT_DIR$/app/src/main/resources/assets/localization/localization_zh.properties" />
|
||||
<base-name>localization</base-name>
|
||||
</custom-resource-bundle>
|
||||
|
||||
@@ -5,6 +5,8 @@ import org.toop.app.layer.layers.MainLayer;
|
||||
import org.toop.app.layer.layers.QuitLayer;
|
||||
import org.toop.framework.asset.ResourceManager;
|
||||
import org.toop.framework.asset.resources.CssAsset;
|
||||
import org.toop.framework.audio.events.AudioEvents;
|
||||
import org.toop.framework.eventbus.EventFlow;
|
||||
import org.toop.local.AppContext;
|
||||
|
||||
import javafx.application.Application;
|
||||
@@ -61,6 +63,7 @@ public final class App extends Application {
|
||||
|
||||
App.isQuitting = false;
|
||||
|
||||
new EventFlow().addPostEvent(new AudioEvents.StartBackgroundMusic()).asyncPostEvent();
|
||||
activate(new MainLayer());
|
||||
}
|
||||
|
||||
|
||||
5
app/src/main/java/org/toop/app/GameInformation.java
Normal file
5
app/src/main/java/org/toop/app/GameInformation.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package org.toop.app;
|
||||
|
||||
public record GameInformation(String[] playerName, boolean[] isPlayerHuman, int[] computerDifficulty,
|
||||
boolean isConnectionLocal, String serverIP, String serverPort) {
|
||||
}
|
||||
@@ -3,31 +3,49 @@ package org.toop.app.canvas;
|
||||
import javafx.scene.canvas.Canvas;
|
||||
import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.input.MouseButton;
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public abstract class GameCanvas {
|
||||
protected record Cell(float x, float y, float width, float height) {}
|
||||
|
||||
protected final int width;
|
||||
protected final int height;
|
||||
protected record Cell(float x, float y, float width, float height) {
|
||||
}
|
||||
|
||||
protected final Canvas canvas;
|
||||
protected final GraphicsContext graphics;
|
||||
|
||||
protected final Color color;
|
||||
|
||||
protected int width;
|
||||
protected int height;
|
||||
|
||||
protected final int rows;
|
||||
protected final int columns;
|
||||
|
||||
protected final int gapSize;
|
||||
protected final boolean edges;
|
||||
|
||||
protected final Cell[] cells;
|
||||
|
||||
protected GameCanvas(int width, int height, int rows, int columns, int gapSize) {
|
||||
final Canvas canvas = new Canvas(width, height);
|
||||
final GraphicsContext graphics = canvas.getGraphicsContext2D();
|
||||
protected GameCanvas(Color color, int width, int height, int rows, int columns, int gapSize, boolean edges, Consumer<Integer> onCellClicked) {
|
||||
canvas = new Canvas(width, height);
|
||||
graphics = canvas.getGraphicsContext2D();
|
||||
|
||||
final Cell[] cells = new Cell[rows * columns];
|
||||
this.color = color;
|
||||
|
||||
final float cellWidth = ((float)width - (rows - 1) * gapSize) / rows;
|
||||
final float cellHeight = ((float)height - (columns - 1) * gapSize) / columns;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
|
||||
this.rows = rows;
|
||||
this.columns = columns;
|
||||
|
||||
this.gapSize = gapSize;
|
||||
this.edges = edges;
|
||||
|
||||
cells = new Cell[rows * columns];
|
||||
|
||||
final float cellWidth = ((float) width - (rows - 1) * gapSize) / rows;
|
||||
final float cellHeight = ((float) height - (columns - 1) * gapSize) / columns;
|
||||
|
||||
for (int y = 0; y < columns; y++) {
|
||||
final float startY = y * cellHeight + y * gapSize;
|
||||
@@ -39,39 +57,67 @@ public abstract class GameCanvas {
|
||||
}
|
||||
|
||||
canvas.setOnMouseClicked(event -> {
|
||||
final MouseButton button = event.getButton();
|
||||
|
||||
if (button != MouseButton.PRIMARY && button != MouseButton.SECONDARY) {
|
||||
if (event.getButton() != MouseButton.PRIMARY) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int column = (int)((event.getX() / width) * rows);
|
||||
final int row = (int)((event.getY() / height) * columns);
|
||||
final int column = (int) ((event.getX() / width) * rows);
|
||||
final int row = (int) ((event.getY() / height) * columns);
|
||||
|
||||
event.consume();
|
||||
onCellClicked(row * rows + column, button == MouseButton.PRIMARY);
|
||||
onCellClicked.accept(row * rows + column);
|
||||
});
|
||||
|
||||
render();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
graphics.clearRect(0, 0, width, height);
|
||||
}
|
||||
|
||||
public void render() {
|
||||
graphics.setFill(color);
|
||||
|
||||
for (int x = 1; x < rows; x++) {
|
||||
graphics.fillRect(cells[x].x() - gapSize, 0, gapSize, height);
|
||||
}
|
||||
|
||||
for (int y = 1; y < columns; y++) {
|
||||
graphics.fillRect(0, cells[y * rows].y() - gapSize, width, gapSize);
|
||||
}
|
||||
|
||||
if (edges) {
|
||||
graphics.fillRect(-gapSize, 0, gapSize, height);
|
||||
graphics.fillRect(0, -gapSize, width, gapSize);
|
||||
|
||||
graphics.fillRect(width - gapSize, 0, gapSize, height);
|
||||
graphics.fillRect(0, height - gapSize, width, gapSize);
|
||||
}
|
||||
}
|
||||
|
||||
public void draw(Color color, int cell) {
|
||||
final float x = cells[cell].x() + gapSize;
|
||||
final float y = cells[cell].y() + gapSize;
|
||||
|
||||
final float width = cells[cell].width() - gapSize * 2;
|
||||
final float height = cells[cell].height() - gapSize * 2;
|
||||
|
||||
graphics.setFill(color);
|
||||
graphics.fillRect(x, y, width, height);
|
||||
}
|
||||
|
||||
public void resize(int width, int height) {
|
||||
canvas.setWidth(width);
|
||||
canvas.setHeight(height);
|
||||
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
|
||||
this.canvas = canvas;
|
||||
this.graphics = graphics;
|
||||
|
||||
this.rows = rows;
|
||||
this.columns = columns;
|
||||
|
||||
this.gapSize = gapSize;
|
||||
|
||||
this.cells = cells;
|
||||
clear();
|
||||
render();
|
||||
}
|
||||
|
||||
protected void clearCell(int cell) {
|
||||
assert cell >= 0 && cell < cells.length;
|
||||
graphics.clearRect(cells[cell].x(), cells[cell].y(), cells[cell].width(), cells[cell].height());
|
||||
public Canvas getCanvas() {
|
||||
return canvas;
|
||||
}
|
||||
|
||||
protected abstract void onCellClicked(int cell, boolean primary);
|
||||
|
||||
public Canvas getCanvas() { return canvas; }
|
||||
}
|
||||
@@ -1,30 +1,16 @@
|
||||
package org.toop.app.canvas;
|
||||
|
||||
import org.toop.game.Game;
|
||||
import org.toop.game.tictactoe.TicTacToe;
|
||||
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class TicTacToeCanvas extends GameCanvas {
|
||||
private final TicTacToe game;
|
||||
|
||||
public TicTacToeCanvas(int width, int height) {
|
||||
super(width, height, 3, 3, 10);
|
||||
game = new TicTacToe();
|
||||
|
||||
graphics.setFill(Color.CYAN);
|
||||
|
||||
for (int x = 1; x < rows; x++) {
|
||||
graphics.fillRect(cells[x].x() - gapSize, 0, gapSize, height);
|
||||
}
|
||||
|
||||
for (int y = 1; y < columns; y++) {
|
||||
graphics.fillRect(0, cells[y * rows].y() - gapSize, width, gapSize);
|
||||
}
|
||||
public TicTacToeCanvas(Color color, int width, int height, Consumer<Integer> onCellClicked) {
|
||||
super(color, width, height, 3, 3, 10, false, onCellClicked);
|
||||
}
|
||||
|
||||
public void placeX(int cell) {
|
||||
graphics.setStroke(Color.ORANGERED);
|
||||
public void drawX(Color color, int cell) {
|
||||
graphics.setStroke(color);
|
||||
graphics.setLineWidth(gapSize);
|
||||
|
||||
final float x = cells[cell].x() + gapSize;
|
||||
@@ -37,8 +23,8 @@ public class TicTacToeCanvas extends GameCanvas {
|
||||
graphics.strokeLine(x + width, y, x, y + height);
|
||||
}
|
||||
|
||||
public void placeO(int cell) {
|
||||
graphics.setStroke(Color.DEEPSKYBLUE);
|
||||
public void drawO(Color color, int cell) {
|
||||
graphics.setStroke(color);
|
||||
graphics.setLineWidth(gapSize);
|
||||
|
||||
final float x = cells[cell].x() + gapSize;
|
||||
@@ -49,33 +35,4 @@ public class TicTacToeCanvas extends GameCanvas {
|
||||
|
||||
graphics.strokeOval(x, y, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCellClicked(int cell, boolean primary) {
|
||||
for (final Game.Move move : game.getLegalMoves()) {
|
||||
if (move.position() == cell) {
|
||||
if (move.value() == 'X') {
|
||||
placeX(cell);
|
||||
} else {
|
||||
placeO(cell);
|
||||
}
|
||||
|
||||
final Game.State state = game.play(move);
|
||||
|
||||
if (state == Game.State.WIN) {
|
||||
for (int i = 0; i < game.board.length; i++) {
|
||||
if (game.board[i] != move.value()) {
|
||||
clearCell(i);
|
||||
}
|
||||
}
|
||||
|
||||
graphics.setFill(Color.GREEN);
|
||||
graphics.fillRect(cells[4].x(), cells[4].y(), cells[4].width(), cells[4].height());
|
||||
} else if (state == Game.State.DRAW) {
|
||||
graphics.setFill(Color.DARKORANGE);
|
||||
graphics.fillRect(cells[4].x(), cells[4].y(), cells[4].width(), cells[4].height());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,5 @@ import org.toop.framework.eventbus.events.EventWithoutSnowflake;
|
||||
import org.toop.framework.eventbus.events.EventsBase;
|
||||
|
||||
public class AppEvents extends EventsBase {
|
||||
public record OnNodeHover() implements EventWithoutSnowflake {}
|
||||
public record OnNodeClick() implements EventWithoutSnowflake {}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package org.toop.app.layer;
|
||||
|
||||
import org.toop.app.events.AppEvents;
|
||||
import org.toop.framework.eventbus.GlobalEventBus;
|
||||
import org.toop.framework.audio.events.AudioEvents;
|
||||
import org.toop.framework.eventbus.EventFlow;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
@@ -42,11 +43,8 @@ public abstract class Container {
|
||||
final Label element = new Label(x);
|
||||
element.getStyleClass().add(cssClass);
|
||||
|
||||
element.setOnMouseEntered(_ -> {
|
||||
GlobalEventBus.post(new AppEvents.OnNodeHover());
|
||||
});
|
||||
|
||||
element.setOnMouseClicked(_ -> {
|
||||
new EventFlow().addPostEvent(new AudioEvents.ClickButton()).asyncPostEvent();
|
||||
runnable.run();
|
||||
});
|
||||
|
||||
@@ -64,11 +62,8 @@ public abstract class Container {
|
||||
|
||||
final BooleanProperty checked = new SimpleBooleanProperty(toggled);
|
||||
|
||||
element.setOnMouseEntered(_ -> {
|
||||
GlobalEventBus.post(new AppEvents.OnNodeHover());
|
||||
});
|
||||
|
||||
element.setOnMouseClicked(_ -> {
|
||||
new EventFlow().addPostEvent(new AudioEvents.ClickButton()).asyncPostEvent();
|
||||
checked.set(!checked.get());
|
||||
|
||||
if (checked.get()) {
|
||||
@@ -99,8 +94,8 @@ public abstract class Container {
|
||||
element.setSnapToTicks(true);
|
||||
element.setShowTickLabels(true);
|
||||
|
||||
element.setOnMouseEntered(_ -> {
|
||||
GlobalEventBus.post(new AppEvents.OnNodeHover());
|
||||
element.setOnMouseClicked(_ -> {
|
||||
new EventFlow().addPostEvent(new AudioEvents.ClickButton()).asyncPostEvent();
|
||||
});
|
||||
|
||||
element.valueProperty().addListener((_, _, newValue) -> {
|
||||
@@ -119,8 +114,8 @@ public abstract class Container {
|
||||
final TextField element = new TextField(input);
|
||||
element.getStyleClass().add(cssClass);
|
||||
|
||||
element.setOnMouseEntered(_ -> {
|
||||
GlobalEventBus.post(new AppEvents.OnNodeHover());
|
||||
element.setOnMouseClicked(_ -> {
|
||||
new EventFlow().addPostEvent(new AudioEvents.ClickButton()).asyncPostEvent();
|
||||
});
|
||||
|
||||
element.textProperty().addListener((_, _, newValue) -> {
|
||||
@@ -139,8 +134,8 @@ public abstract class Container {
|
||||
final ChoiceBox<T> element = new ChoiceBox<>();
|
||||
element.getStyleClass().add(cssClass);
|
||||
|
||||
element.setOnMouseEntered(_ -> {
|
||||
GlobalEventBus.post(new AppEvents.OnNodeHover());
|
||||
element.setOnMouseClicked(_ -> {
|
||||
new EventFlow().addPostEvent(new AudioEvents.ClickButton()).asyncPostEvent();
|
||||
});
|
||||
|
||||
element.valueProperty().addListener((_, _, newValue) -> {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.toop.app.layer;
|
||||
|
||||
import org.toop.app.App;
|
||||
import org.toop.app.canvas.GameCanvas;
|
||||
import org.toop.framework.asset.ResourceManager;
|
||||
import org.toop.framework.asset.resources.CssAsset;
|
||||
|
||||
@@ -47,6 +48,18 @@ public abstract class Layer {
|
||||
layer.getChildren().addLast(container.getContainer());
|
||||
}
|
||||
|
||||
protected void addGameCanvas(GameCanvas canvas, Pos position, int xOffset, int yOffset) {
|
||||
StackPane.setAlignment(canvas.getCanvas(), position);
|
||||
|
||||
final double widthUnit = App.getWidth() / 100.0;
|
||||
final double heightUnit = App.getHeight() / 100.0;
|
||||
|
||||
canvas.getCanvas().setTranslateX(xOffset * widthUnit);
|
||||
canvas.getCanvas().setTranslateY(yOffset * heightUnit);
|
||||
|
||||
layer.getChildren().addLast(canvas.getCanvas());
|
||||
}
|
||||
|
||||
protected void pop() {
|
||||
if (layer.getChildren().size() <= 1) {
|
||||
return;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package org.toop.app.layer.layers;
|
||||
|
||||
import org.toop.app.App;
|
||||
import org.toop.app.layer.Container;
|
||||
import org.toop.app.layer.Layer;
|
||||
import org.toop.app.layer.containers.VerticalContainer;
|
||||
import org.toop.local.AppContext;
|
||||
|
||||
import javafx.geometry.Pos;
|
||||
|
||||
public class GameLayer extends Layer {
|
||||
public GameLayer() {
|
||||
super("game.css");
|
||||
reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload() {
|
||||
App.popAll();
|
||||
|
||||
final Container controlContainer = new VerticalContainer(5);
|
||||
|
||||
controlContainer.addButton(AppContext.getString("back"), () -> {
|
||||
App.activate(new MainLayer());
|
||||
});
|
||||
|
||||
addContainer(controlContainer, Pos.BOTTOM_LEFT, 2, -2, 0, 0);
|
||||
}
|
||||
}
|
||||
@@ -23,11 +23,11 @@ public final class MainLayer extends Layer {
|
||||
final Container gamesContainer = new VerticalContainer(5);
|
||||
|
||||
gamesContainer.addButton(AppContext.getString("tictactoe"), () -> {
|
||||
App.activate(new MultiplayerLayer<TicTacToe>());
|
||||
App.activate(new MultiplayerLayer());
|
||||
});
|
||||
|
||||
gamesContainer.addButton(AppContext.getString("othello"), () -> {
|
||||
App.activate(new MultiplayerLayer<Othello>());
|
||||
App.activate(new MultiplayerLayer());
|
||||
});
|
||||
|
||||
final Container controlContainer = new VerticalContainer(5);
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package org.toop.app.layer.layers;
|
||||
|
||||
import org.toop.app.App;
|
||||
import org.toop.app.GameInformation;
|
||||
import org.toop.app.layer.Container;
|
||||
import org.toop.app.layer.Layer;
|
||||
import org.toop.app.layer.containers.HorizontalContainer;
|
||||
import org.toop.app.layer.containers.VerticalContainer;
|
||||
import org.toop.game.TurnBasedGame;
|
||||
import org.toop.app.layer.layers.game.TicTacToeLayer;
|
||||
import org.toop.local.AppContext;
|
||||
|
||||
import javafx.geometry.Pos;
|
||||
|
||||
public final class MultiplayerLayer<T extends TurnBasedGame> extends Layer {
|
||||
public final class MultiplayerLayer extends Layer {
|
||||
private boolean isConnectionLocal = true;
|
||||
|
||||
private boolean isPlayer1Human = true;
|
||||
@@ -54,13 +55,13 @@ public final class MultiplayerLayer<T extends TurnBasedGame> extends Layer {
|
||||
|
||||
playersContainer.addContainer(player2Container, true);
|
||||
|
||||
if (isConnectionLocal) {
|
||||
mainContainer.addButton(AppContext.getString("start"), () -> {
|
||||
});
|
||||
} else {
|
||||
mainContainer.addButton(AppContext.getString("connect"), () -> {
|
||||
});
|
||||
}
|
||||
mainContainer.addButton(isConnectionLocal? AppContext.getString("start") : AppContext.getString("connect"), () -> {
|
||||
App.activate(new TicTacToeLayer(new GameInformation(
|
||||
new String[] { player1Name, player2Name },
|
||||
new boolean[] { isPlayer1Human, isPlayer2Human },
|
||||
new int[] { computer1Difficulty, computer2Difficulty },
|
||||
isConnectionLocal, serverIP, serverPort)));
|
||||
});
|
||||
|
||||
player1Container.addToggle(AppContext.getString("human"), AppContext.getString("computer"), !isPlayer1Human, (computer) -> {
|
||||
isPlayer1Human = !computer;
|
||||
|
||||
@@ -14,7 +14,7 @@ import javafx.scene.control.ChoiceBox;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class OptionsLayer extends Layer {
|
||||
private static int currentVolume = 25;
|
||||
private static int currentVolume = 0;
|
||||
private static boolean isWindowed = true;
|
||||
|
||||
OptionsLayer() {
|
||||
@@ -84,7 +84,7 @@ public final class OptionsLayer extends Layer {
|
||||
private void addVolumeSlider(Container container) {
|
||||
container.addSlider(100, currentVolume, (volume) -> {
|
||||
currentVolume = volume;
|
||||
new EventFlow().addPostEvent(new AudioEvents.ChangeVolume(volume.doubleValue() / 100.0)).asyncPostEvent();
|
||||
new EventFlow().addPostEvent(new AudioEvents.ChangeVolume(volume.doubleValue())).asyncPostEvent();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
package org.toop.app.layer.layers.game;
|
||||
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.paint.Color;
|
||||
import org.toop.app.App;
|
||||
import org.toop.app.GameInformation;
|
||||
import org.toop.app.canvas.TicTacToeCanvas;
|
||||
import org.toop.app.layer.Container;
|
||||
import org.toop.app.layer.Layer;
|
||||
import org.toop.app.layer.containers.VerticalContainer;
|
||||
import org.toop.app.layer.layers.MainLayer;
|
||||
import org.toop.game.Game;
|
||||
import org.toop.game.tictactoe.TicTacToe;
|
||||
import org.toop.game.tictactoe.TicTacToeAI;
|
||||
import org.toop.local.AppContext;
|
||||
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
public final class TicTacToeLayer extends Layer {
|
||||
private TicTacToeCanvas canvas;
|
||||
|
||||
private TicTacToe ticTacToe;
|
||||
private TicTacToeAI ticTacToeAI;
|
||||
|
||||
private GameInformation information;
|
||||
|
||||
private final BlockingQueue<Game.Move> playerMoveQueue = new LinkedBlockingQueue<>();
|
||||
|
||||
public TicTacToeLayer(GameInformation information) {
|
||||
super("game.css");
|
||||
|
||||
canvas = new TicTacToeCanvas(Color.WHITE, (App.getHeight() / 100) * 75, (App.getHeight() / 100) * 75, (cell) -> {
|
||||
try {
|
||||
playerMoveQueue.put(new Game.Move(cell, 'X'));
|
||||
} catch (InterruptedException e) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
ticTacToe = new TicTacToe();
|
||||
ticTacToeAI = new TicTacToeAI();
|
||||
|
||||
this.information = information;
|
||||
|
||||
if (information.isConnectionLocal()) {
|
||||
new Thread(this::localGameThread).start();
|
||||
}
|
||||
|
||||
reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload() {
|
||||
popAll();
|
||||
|
||||
canvas.resize((App.getHeight() / 100) * 75, (App.getHeight() / 100) * 75);
|
||||
|
||||
for (int i = 0; i < ticTacToe.board.length; i++) {
|
||||
final char value = ticTacToe.board[i];
|
||||
|
||||
if (value == 'X') {
|
||||
canvas.drawX(Color.RED, i);
|
||||
} else if (value == 'O') {
|
||||
canvas.drawO(Color.BLUE, i);
|
||||
}
|
||||
}
|
||||
|
||||
final Container controlContainer = new VerticalContainer(5);
|
||||
|
||||
if (information.isPlayerHuman()[0] || information.isConnectionLocal() && information.isPlayerHuman()[1]) {
|
||||
controlContainer.addButton(AppContext.getString("hint"), () -> {
|
||||
});
|
||||
}
|
||||
|
||||
controlContainer.addButton(AppContext.getString("back"), () -> {
|
||||
App.activate(new MainLayer());
|
||||
});
|
||||
|
||||
addContainer(controlContainer, Pos.BOTTOM_LEFT, 2, -2, 0, 0);
|
||||
addGameCanvas(canvas, Pos.CENTER, 0, 0);
|
||||
}
|
||||
|
||||
private int compurterDifficultyToDepth(int maxDifficulty, int difficulty) {
|
||||
return (int) (((float) maxDifficulty / difficulty) * 9);
|
||||
}
|
||||
|
||||
private void localGameThread() {
|
||||
boolean running = true;
|
||||
|
||||
while (running) {
|
||||
final int currentPlayer = ticTacToe.getCurrentTurn();
|
||||
|
||||
System.out.println("test");
|
||||
|
||||
Game.Move move = null;
|
||||
|
||||
if (information.isPlayerHuman()[currentPlayer]) {
|
||||
try {
|
||||
move = playerMoveQueue.take();
|
||||
} catch (InterruptedException exception) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
move = ticTacToeAI.findBestMove(ticTacToe, compurterDifficultyToDepth(9, information.computerDifficulty()[currentPlayer]));
|
||||
}
|
||||
|
||||
assert move != null;
|
||||
final Game.State state = ticTacToe.play(move);
|
||||
|
||||
if (move.value() == 'X') {
|
||||
canvas.drawX(Color.RED, move.position());
|
||||
} else if (move.value() == 'O') {
|
||||
canvas.drawO(Color.BLUE, move.position());
|
||||
}
|
||||
|
||||
if (state != Game.State.NORMAL) {
|
||||
if (state == Game.State.WIN) {
|
||||
// Win logic
|
||||
} else if (state == Game.State.DRAW) {
|
||||
// Draw logic
|
||||
}
|
||||
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 357 KiB |
@@ -0,0 +1,47 @@
|
||||
ai=\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0635\u0646\u0627\u0639\u064a
|
||||
appTitle=\u0645\u062e\u062a\u0627\u0631 \u0623\u0644\u0639\u0627\u0628 ISY
|
||||
back=\u0631\u062c\u0648\u0639
|
||||
computer=\u0627\u0644\u062d\u0627\u0633\u0648\u0628
|
||||
computerDifficulty=\u0635\u0639\u0648\u0628\u0629 \u0627\u0644\u062d\u0627\u0633\u0648\u0628
|
||||
connect=\u0627\u062a\u0635\u0644
|
||||
credits=\u0627\u0644\u0634\u0643\u0631 \u0648\u0627\u0644\u062a\u0642\u062f\u064a\u0631
|
||||
developers=\u0627\u0644\u0645\u0637\u0648\u0631\u0648\u0646
|
||||
fullscreen=\u0643\u0627\u0645\u0644 \u0627\u0644\u0634\u0627\u0634\u0629
|
||||
hint=\u062a\u0644\u0645\u064a\u062d
|
||||
human=\u0627\u0644\u0625\u0646\u0633\u0627\u0646
|
||||
language=\u0627\u0644\u0644\u063a\u0629
|
||||
local=\u0645\u062d\u0644\u064a
|
||||
localization=\u062a\u0648\u0645\u064a\u0645 \u0627\u0644\u0644\u063a\u0629
|
||||
mergeCommander=\u0642\u0627\u0626\u062f \u0627\u0644\u062f\u0645\u062c
|
||||
moralSupport=\u062f\u0639\u0645 \u0645\u0639\u0646\u0648\u064a
|
||||
no=\u0644\u0627
|
||||
opengl=OpenGL
|
||||
options=\u0627\u0644\u062e\u064a\u0627\u0631\u0627\u062a
|
||||
othello=\u0623\u0648\u062a\u064a\u0644\u0648
|
||||
playerName=\u0627\u0633\u0645 \u0627\u0644\u0644\u0627\u0639\u0628
|
||||
productOwner=\u0645\u0627\u0644\u0643 \u0627\u0644\u0645\u0646\u062a\u062c
|
||||
quit=\u062e\u0631\u0648\u062c
|
||||
quitSure=\u0647\u0644 \u0623\u0646\u062a \u0645\u062a\u0623\u0643\u062f\u061f
|
||||
scrumMaster=\u0645\u062f\u064a\u0631 \u0627\u0644\u0633\u0643\u0631\u0645
|
||||
server=\u062e\u0627\u062f\u0645
|
||||
serverIP=IP \u0627\u0644\u062e\u0627\u062f\u0645
|
||||
serverPort=\u0645\u0646\u0641\u0630 \u0627\u0644\u062e\u0627\u062f\u0645
|
||||
start=\u0627\u0628\u062f\u0623
|
||||
tictactoe=\u062a\u064a\u0643 \u062a\u0627\u0643 \u062a\u0648
|
||||
volume=\u0627\u0644\u0635\u0648\u062a
|
||||
windowed=\u0646\u0627\u0641\u0630\u064a
|
||||
yes=\u0646\u0639\u0645
|
||||
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629
|
||||
chinese=\u4e2d\u6587 (\u0627\u0644\u0635\u064a\u0646\u064a\u0629)
|
||||
dutch=Nederlands (\u0627\u0644\u0647\u0648\u0644\u0646\u062f\u064a\u0629)
|
||||
english=English (\u0627\u0644\u0625\u0646\u062c\u0644\u064a\u0632\u064a\u0629)
|
||||
french=Fran\u00e7ais (\u0627\u0644\u0641\u0631\u0646\u0633\u064a\u0629)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (\u0627\u0644\u062c\u0648\u0631\u062c\u064a\u0629)
|
||||
german=Deutsch (\u0627\u0644\u0623\u0644\u0645\u0627\u0646\u064a\u0629)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (\u0627\u0644\u0647\u0646\u062f\u064a\u0629)
|
||||
italian=Italiano (\u0627\u0644\u0625\u064a\u0637\u0627\u0644\u064a\u0629)
|
||||
japanese=\u65e5\u672c\u8a9e (\u0627\u0644\u064a\u0627\u0628\u0627\u0646\u064a\u0629)
|
||||
korean=\ud55c\uad6d\uc5b4 (\u0627\u0644\u0643\u0648\u0631\u064a\u0629)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (\u0627\u0644\u0631\u0648\u0633\u064a\u0629)
|
||||
spanish=Espa\u00f1ol (\u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064a\u0629)
|
||||
@@ -7,6 +7,7 @@ connect=Verbinden
|
||||
credits=Credits
|
||||
developers=Entwickler
|
||||
fullscreen=Vollbild
|
||||
hint=Hinweis
|
||||
human=Mensch
|
||||
language=Sprache
|
||||
local=Lokal
|
||||
@@ -31,10 +32,16 @@ volume=Lautst\u00e4rke
|
||||
windowed=Fenstermodus
|
||||
yes=Ja
|
||||
|
||||
chinese=\u4e2d\u6587
|
||||
dutch=Nederlands
|
||||
english=English
|
||||
french=Fran\u00e7ais
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabisch)
|
||||
chinese=\u4e2d\u6587 (Chinesisch)
|
||||
dutch=Nederlands (Niederl\u00e4ndisch)
|
||||
english=English (Englisch)
|
||||
french=Fran\u00e7ais (Franz\u00f6sisch)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (Georgisch)
|
||||
german=Deutsch
|
||||
italian=Italiano
|
||||
spanish=Espa\u00f1ol
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (Hindi)
|
||||
italian=Italiano (Italienisch)
|
||||
japanese=\u65e5\u672c\u8a9e (Japanisch)
|
||||
korean=\ud55c\uad6d\uc5b4 (Koreanisch)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russisch)
|
||||
spanish=Espa\u00f1ol (Spanisch)
|
||||
@@ -7,6 +7,7 @@ connect=Connect
|
||||
credits=Credits
|
||||
developers=Developers
|
||||
fullscreen=Fullscreen
|
||||
hint=Hint
|
||||
human=Human
|
||||
language=Language
|
||||
local=Local
|
||||
@@ -31,10 +32,16 @@ volume=Volume
|
||||
windowed=Windowed
|
||||
yes=Yes
|
||||
|
||||
chinese=\u4e2d\u6587
|
||||
dutch=Nederlands
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabic)
|
||||
chinese=\u4e2d\u6587 (Chinese)
|
||||
dutch=Nederlands (Dutch)
|
||||
english=English
|
||||
french=Fran\u00e7ais
|
||||
german=Deutsch
|
||||
italian=Italiano
|
||||
spanish=Espa\u00f1ol
|
||||
french=Fran\u00e7ais (French)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (Georgian)
|
||||
german=Deutsch (German)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (Hindi)
|
||||
italian=Italiano (Italian)
|
||||
japanese=\u65e5\u672c\u8a9e (Japanese)
|
||||
korean=\ud55c\uad6d\uc5b4 (Korean)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russian)
|
||||
spanish=Espa\u00f1ol (Spanish)
|
||||
@@ -7,6 +7,7 @@ connect=Conectar
|
||||
credits=Cr\u00e9ditos
|
||||
developers=Desarrolladores
|
||||
fullscreen=Pantalla completa
|
||||
hint=Pista
|
||||
human=Humano
|
||||
language=Idioma
|
||||
local=Local
|
||||
@@ -31,10 +32,16 @@ volume=Volumen
|
||||
windowed=Ventana
|
||||
yes=S\u00ed
|
||||
|
||||
chinese=\u4e2d\u6587
|
||||
dutch=Nederlands
|
||||
english=English
|
||||
french=Fran\u00e7ais
|
||||
german=Deutsch
|
||||
italian=Italiano
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Ar\u00e1bigo)
|
||||
chinese=\u4e2d\u6587 (Chino)
|
||||
dutch=Nederlands (Neerland\u00e9s)
|
||||
english=English (Ingl\u00e9s)
|
||||
french=Fran\u00e7ais (Franc\u00e9s)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (Georgiano)
|
||||
german=Deutsch (Alem\u00e1n)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (Hindi)
|
||||
italian=Italiano (Italiano)
|
||||
japanese=\u65e5\u672c\u8a9e (Japon\u00e9s)
|
||||
korean=\ud55c\uad6d\uc5b4 (Coreano)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Ruso)
|
||||
spanish=Espa\u00f1ol
|
||||
@@ -7,6 +7,7 @@ connect=Connecter
|
||||
credits=Cr\u00e9dits
|
||||
developers=D\u00e9veloppeurs
|
||||
fullscreen=Plein \u00e9cran
|
||||
hint=Indice
|
||||
human=Humain
|
||||
language=Langue
|
||||
local=Local
|
||||
@@ -31,10 +32,16 @@ volume=Volume
|
||||
windowed=Fen\u00eatre
|
||||
yes=Oui
|
||||
|
||||
chinese=\u4e2d\u6587
|
||||
dutch=Nederlands
|
||||
english=English
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabe)
|
||||
chinese=\u4e2d\u6587 (Chinois)
|
||||
dutch=Nederlands (N\u00e9erlandais)
|
||||
english=English (Anglais)
|
||||
french=Fran\u00e7ais
|
||||
german=Deutsch
|
||||
italian=Italiano
|
||||
spanish=Espa\u00f1ol
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (G\u00e9orgien)
|
||||
german=Deutsch (Allemand)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (Hindi)
|
||||
italian=Italiano (Italien)
|
||||
japanese=\u65e5\u672c\u8a9e (Japonais)
|
||||
korean=\ud55c\uad6d\uc5b4 (Cor\u00e9en)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russe)
|
||||
spanish=Espa\u00f1ol (Espagnol)
|
||||
@@ -0,0 +1,47 @@
|
||||
ai=\u092a\u094d\u0930\u0924\u093f\u092a\u094d\u0930\u0923\u093e\u0924\u094d\u092e\u093e\u0928 \u092a\u094d\u0930\u092c\u094d\u0939\u093e\u0935\u0924\u094d\u0924\u093e
|
||||
appTitle=ISY \u0917\u0947\u092e \u0938\u0947\u0932\u0947\u0915\u094d\u091f\u0930
|
||||
back=\u092a\u093f\u091a\u093e\u0932
|
||||
computer=\u0915\u092e\u092a\u094d\u092f\u0942\u091f\u0930
|
||||
computerDifficulty=\u0915\u092e\u092a\u094d\u092f\u0942\u091f\u0930 \u092a\u094d\u0930\u092f\u093e\u0938
|
||||
connect=\u091c\u0942\u0921\u094d\u0921 \u0915\u0930\u0947\u0902
|
||||
credits=\u0916\u094d\u092f\u093e\u0924\u0947
|
||||
developers=\u0935\u093f\u0915\u0938\u093f\u0915\u0930
|
||||
fullscreen=\u092a\u0942\u0930\u094d\u0923 \u0938\u0915\u0940\u0928\u093e
|
||||
hint=\u0938\u0902\u0917\u094d\u0917
|
||||
human=\u092e\u093e\u0928\u0935
|
||||
language=\u092d\u093e\u0937\u093e
|
||||
local=\u0938\u094d\u0925\u093e\u0928\u093f\u092f
|
||||
localization=\u0938\u094d\u0925\u093e\u0928\u093f\u092f\u0915\u0930\u0923
|
||||
mergeCommander=\u092e\u0930\u094d\u091c \u0915\u092e\u0902\u0921\u0930
|
||||
moralSupport=\u0928\u094d\u092e\u093e\u0928\u093f\u0915 \u0938\u092e\u0930\u094d\u0925\u0928
|
||||
no=\u0928\u0939\u0940\u0902
|
||||
opengl=OpenGL
|
||||
options=\u0935\u093f\u0915\u0932\u094d\u092a
|
||||
othello=\u0913\u0925\u0940\u0932\u094b
|
||||
playerName=\u0915\u0941\u0930\u093e\u0930\u0940 \u0928\u093e\u092e
|
||||
productOwner=\u0906\u092f\u0947\u0915\u093e \u092e\u093e\u0932\u093f\u0915
|
||||
quit=\u0938\u094e\u091c\u094d
|
||||
quitSure=\u0915\u094d\u092f\u093e \u0915\u094d\u092f\u093e \u091f\u0940\u091f \u0939\u0948\u0902?
|
||||
scrumMaster=\u0938\u094d\u0915\u094d\u0930\u0941\u092e \u092e\u093e\u0938\u094d\u091f\u0930
|
||||
server=\u0938\u0930\u094d\u0935\u0930
|
||||
serverIP=\u0938\u0930\u094d\u0935\u0930 IP
|
||||
serverPort=\u0938\u0930\u094d\u0935\u0930 \u092a\u094b\u0930\u094d\u091f
|
||||
start=\u092b\u093f\u0930\u0942
|
||||
tictactoe=\u091f\u093f\u0915 \u091f\u0948\u0915 \u091f\u094b
|
||||
volume=\u0935\u0949\u0932\u094d\u092f\u0947\u092e
|
||||
windowed=\u0915\u094d\u0930\u094d\u0939 \u092e\u0947\u0902
|
||||
yes=\u0939\u093e\u0907
|
||||
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0905\u0930\u092c\u0940)
|
||||
chinese=\u4e2d\u6587 (\u091a\u0940\u0928\u0940)
|
||||
dutch=Nederlands (\u0921\u091a)
|
||||
english=English (\u0905\u0902\u0917\u094d\u0930\u0947\u091c\u0940)
|
||||
french=Fran\u00e7ais (\u092b\u094d\u0930\u0947\u0902\u091a)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (\u091c\u094d\u091c\u094b\u0930\u094d\u091c\u093f\u092f\u0928)
|
||||
german=Deutsch (\u091c\u0930\u094d\u092e\u0928)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940
|
||||
italian=Italiano (\u0907\u091f\u093e\u0932\u093f\u092f\u0928)
|
||||
japanese=\u65e5\u672c\u8a9e (\u091c\u093e\u092a\u093e\u0928\u0940)
|
||||
korean=\ud55c\uad6d\uc5b4 (\u0915\u094b\u0930\u093f\u092f\u0928)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (\u0930\u0942\u0938\u0940)
|
||||
spanish=Espa\u00f1ol (\u0938\u094d\u092a\u0947\u0928\u093f\u0936)
|
||||
@@ -7,6 +7,7 @@ connect=Connetti
|
||||
credits=Crediti
|
||||
developers=Sviluppatori
|
||||
fullscreen=Schermo intero
|
||||
hint=Suggerimento
|
||||
human=Umano
|
||||
language=Lingua
|
||||
local=Locale
|
||||
@@ -31,10 +32,16 @@ volume=Volume
|
||||
windowed=Finestra
|
||||
yes=S\u00ec
|
||||
|
||||
chinese=\u4e2d\u6587
|
||||
dutch=Nederlands
|
||||
english=English
|
||||
french=Fran\u00e7ais
|
||||
german=Deutsch
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabo)
|
||||
chinese=\u4e2d\u6587 (Cinese)
|
||||
dutch=Nederlands (Olandese)
|
||||
english=English (Inglese)
|
||||
french=Fran\u00e7ais (Francese)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (Georgiano)
|
||||
german=Deutsch (Tedesco)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (Hindi)
|
||||
italian=Italiano
|
||||
spanish=Espa\u00f1ol
|
||||
japanese=\u65e5\u672c\u8a9e (Giapponese)
|
||||
korean=\ud55c\uad6d\uc5b4 (Coreano)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russo)
|
||||
spanish=Espa\u00f1ol (Spagnolo)
|
||||
@@ -0,0 +1,47 @@
|
||||
ai=\u4eba\u5de5\u77e5\u80fd
|
||||
appTitle=ISY \u30b2\u30fc\u30e0\u30bb\u30ec\u30af\u30bf\u30fc
|
||||
back=\u623b\u308b
|
||||
computer=\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc
|
||||
computerDifficulty=\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u96e3\u6613\u5ea6
|
||||
connect=\u63a5\u7d9a
|
||||
credits=\u30af\u30ec\u30b8\u30c3\u30c8
|
||||
developers=\u958b\u767a\u8005
|
||||
fullscreen=\u5168\u753b\u9762
|
||||
hint=\u30d2\u30f3\u30c8
|
||||
human=\u4eba\u9593
|
||||
language=\u8a00\u8a9e
|
||||
local=\u5730\u57df
|
||||
localization=\u30ed\u30fc\u30ab\u30e9\u30a4\u30bc\u30fc\u30b7\u30e7\u30f3
|
||||
mergeCommander=\u30de\u30fc\u30b8\u30b3\u30de\u30f3\u30c0\u30fc
|
||||
moralSupport=\u6c17\u529b\u652f\u63f4
|
||||
no=\u3044\u3044\u3048
|
||||
opengl=OpenGL
|
||||
options=\u30aa\u30d7\u30b7\u30e7\u30f3
|
||||
othello=\u30aa\u30bb\u30ed
|
||||
playerName=\u30d7\u30ec\u30a4\u30e4\u30fc\u540d
|
||||
productOwner=\u30d7\u30ed\u30c0\u30af\u30c8\u30aa\u30fc\u30ca\u30fc
|
||||
quit=\u7d42\u4e86
|
||||
quitSure=\u672c\u5f53\u306b\u7d42\u4e86\u3057\u307e\u3059\u304b\uff1f
|
||||
scrumMaster=\u30b9\u30af\u30e9\u30e0\u30de\u30b9\u30bf\u30fc
|
||||
server=\u30b5\u30fc\u30d0\u30fc
|
||||
serverIP=\u30b5\u30fc\u30d0\u30fc IP
|
||||
serverPort=\u30b5\u30fc\u30d0\u30fc \u30dd\u30fc\u30c8
|
||||
start=\u59cb\u307e\u308a
|
||||
tictactoe=\u30bf\u30a4\u30af\u30bf\u30c3\u30c8\u30c8\u30a6
|
||||
volume=\u30dc\u30ea\u30e5\u30fc\u30e0
|
||||
windowed=\u30a6\u30a3\u30f3\u30c9\u30a6
|
||||
yes=\u306f\u3044
|
||||
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u30a2\u30e9\u30d3\u30a2\u8a9e)
|
||||
chinese=\u4e2d\u6587 (\u4e2d\u6587)
|
||||
dutch=Nederlands (\u30aa\u30e9\u30f3\u30c0\u8a9e)
|
||||
english=English (\u82f1\u8a9e)
|
||||
french=Fran\u00e7ais (\u30d5\u30e9\u30f3\u30b9\u8a9e)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (\u30b0\u30eb\u30b8\u30a2\u8a9e)
|
||||
german=Deutsch (\u30c9\u30a4\u30c4\u8a9e)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (\u30d2\u30f3\u30c7\u30a3\u8a9e)
|
||||
italian=Italiano (\u30a4\u30bf\u30ea\u30a2\u8a9e)
|
||||
japanese=\u65e5\u672c\u8a9e
|
||||
korean=\ud55c\uad6d\uc5b4 (\u97d3\u56fd\u8a9e)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (\u30ed\u30b7\u30a2\u8a9e)
|
||||
spanish=Espa\u00f1ol (\u30b9\u30da\u30a4\u30f3\u8a9e)
|
||||
@@ -0,0 +1,47 @@
|
||||
ai=\u10e1\u10d0\u10e0\u10d7\u10d5\u10d4\u10d9\u10d8 \u10d8\u10e0\u10d5\u10d5\u10e0\u10d8\u10d2\u10d4\u10d1\u10d0
|
||||
appTitle=ISY \u10d2\u10d4\u10db\u10d3\u10d8 \u10e1\u10d4\u10da\u10d4\u10ea\u10d9\u10d4\u10da\u10d0
|
||||
back=\u10db\u10d0\u10d2\u10d0\u10dc\u10d0
|
||||
computer=\u10e2\u10d0\u10db\u10d7\u10d8\u10d2\u10d3\u10d0\u10e0\u10d8
|
||||
computerDifficulty=\u10e8\u10d0\u10d5\u10d0\u10e0\u10d8 \u10e2\u10d0\u10db\u10d7\u10d8\u10d2\u10d3\u10d0\u10e0\u10d8
|
||||
connect=\u10d7\u10d0\u10db\u10d0\u10d4\u10e0\u10d7\u10d8
|
||||
credits=\u10d9\u10d0\u10e0\u10d4\u10d3\u10d0\u10e0\u10d8
|
||||
developers=\u10db\u10d0\u10e0\u10e3\u10d1\u10d7\u10d0\u10ea\u10d4\u10da\u10d8
|
||||
fullscreen=\u10e1\u10d0\u10e5\u10d8 \u10d8\u10e0\u10e2\u10d8\u10d5\u10d0\u10e0\u10d8
|
||||
hint=\u10db\u10d8\u10e0\u10d7\u10d4\u10da\u10d8
|
||||
human=\u10db\u10d4\u10db\u10d0\u10dc\u10d8
|
||||
language=\u10dc\u10d0\u10db\u10d0
|
||||
local=\u10db\u10d4\u10e0\u10d7\u10d4\u10da\u10d0\u10e0\u10d8
|
||||
localization=\u10d0\u10e1\u10d5\u10e0\u10d0\u10e2\u10d4\u10da\u10d0\u10e0\u10d8
|
||||
mergeCommander=\u10db\u10d4\u10e0\u10d7\u10d4\u10da\u10d8 \u10d9\u10d0\u10dc\u10d3\u10d0\u10e0\u10d8
|
||||
moralSupport=\u10db\u10d0\u10e0\u10d4\u10dc\u10d8 \u10d3\u10d0\u10db\u10d4\u10d4\u10da\u10d4\u10da\u10d0
|
||||
no=\u10dc\u10d4
|
||||
opengl=OpenGL
|
||||
options=\u10e3\u10e0\u10d5\u10d4\u10da\u10d8
|
||||
othello=\u10d0\u10e2\u10e5\u10d4\u10da\u10d8
|
||||
playerName=\u10dc\u10d0\u10e0\u10d4 \u10db\u10d0\u10e5\u10d3\u10d0\u10e0\u10d8
|
||||
productOwner=\u10db\u10d0\u10e0\u10e3\u10d1\u10d7\u10d0\u10e0\u10d8 \u10db\u10d0\u10dc\u10e2\u10d0\u10e0\u10d8
|
||||
quit=\u10db\u10d0\u10e0\u10d7\u10d4\u10da\u10d8
|
||||
quitSure=\u10ec\u10d7\u10d0 \u10db\u10d0\u10e0 \u10db\u10d0\u10e0\u10d7\u10d4\u10da\u10d8?
|
||||
scrumMaster=\u10e1\u10e0\u10d9\u10d3 \u10db\u10d0\u10e1\u10d7\u10d0\u10e0\u10d8
|
||||
server=\u10e1\u10d0\u10e0\u10d7\u10d4\u10e0\u10d8
|
||||
serverIP=\u10e1\u10d0\u10e0\u10d7\u10d4\u10e0\u10d8 IP
|
||||
serverPort=\u10e1\u10d0\u10e0\u10d7\u10d4\u10e0\u10d8 \u10e2\u10dd\u10e0\u10d7\u10d0
|
||||
start=\u10e0\u10d0\u10d3\u10d4\u10e1
|
||||
tictactoe=\u10e2\u10d8\u10d9\u10d8 \u10e2\u10d8\u10e9\u10d8 \u10e2\u10d8
|
||||
volume=\u10d7\u10d0\u10e7\u10d8
|
||||
windowed=\u10e1\u10d0\u10db\u10d7\u10d8
|
||||
yes=\u10d3\u10d0
|
||||
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u10d0\u10e0\u10d0\u10d1\u10d8\u10d1\u10d3\u10d3\u10d4\u10da\u10d8)
|
||||
chinese=\u4e2d\u6587 (\u10d9\u10d8\u10e2\u10d8\u10e1\u10d8)
|
||||
dutch=Nederlands (\u10db\u10d4\u10d3\u10d0\u10da\u10d0\u10dc\u10d3\u10d8)
|
||||
english=English (\u10d2\u10d0\u10e0\u10d7\u10d8\u10e1\u10d8)
|
||||
french=Fran\u00e7ais (\u10e4\u10e0\u10d0\u10dc\u10d9\u10e3\u10e1\u10d8)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8
|
||||
german=Deutsch (\u10db\u10d4\u10db\u10d4\u10e6\u10d8)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (\u10f0\u10d4\u10dc\u10d3\u10d8)
|
||||
italian=Italiano (\u10d7\u10d4\u10ea\u10d0\u10da\u10d8)
|
||||
japanese=\u65e5\u672c\u8a9e (\u10d9\u10d0\u10e7\u10d0\u10dc\u10d8)
|
||||
korean=\ud55c\uad6d\uc5b4 (\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (\u10e0\u10e3\u10e1\u10e1\u10d8\u10d5\u10d4\u10d1\u10d8)
|
||||
spanish=Espa\u00f1ol (\u10e1\u10da\u10d0\u10dc\u10d8)
|
||||
@@ -0,0 +1,47 @@
|
||||
ai=\uc778\uacf5 \uc9c0\ub2a5
|
||||
appTitle=ISY \uac8c\uc784 \uc120\ud0dd\uae30
|
||||
back=\ub4a4\ub85c
|
||||
computer=\uce74\ud14c\uae4c
|
||||
computerDifficulty=\uce74\ud14c\uae4c \ub2e8\uacc4
|
||||
connect=\uc5f0\uacb0
|
||||
credits=\uac10\uc0ac
|
||||
developers=\uac1c\ubc1c\uc790
|
||||
fullscreen=\uc804\uccb4 \ud654\uba74
|
||||
hint=\ud78c\ud2b8
|
||||
human=\uc778\uac04
|
||||
language=\uc5b8\uc5b4
|
||||
local=\ub85c\uceec
|
||||
localization=\uc5b8\uc5b4\ud654
|
||||
mergeCommander=\uba54\uc9c0 \ucea0\ub9ac\ub354
|
||||
moralSupport=\uc815\uc2e0\uc801 \uc9c0\uc6d0
|
||||
no=\uc544\ub2c8\uc624
|
||||
opengl=OpenGL
|
||||
options=\uc635\uc158
|
||||
othello=\uc624\ud14c\ub85c
|
||||
playerName=\ud50c\ub808\uc774\uc5b4 \uc774\ub984
|
||||
productOwner=\uc81c\ud488 \uad00\ub9ac\uc790
|
||||
quit=\uc885\ub8cc
|
||||
quitSure=\uc815\ub9d0 \uc885\ub8cc\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?
|
||||
scrumMaster=\uc2a4\ud06c\ub7fc \ub9c8\uc2a4\ud130
|
||||
server=\uc11c\ubc84
|
||||
serverIP=\uc11c\ubc84 IP
|
||||
serverPort=\uc11c\ubc84 \ud3ec\ud2b8
|
||||
start=\uc2dc\uc791
|
||||
tictactoe=\ud2f0\ud06c\ud0d0\ud1a0
|
||||
volume=\ubcf4\ub7ec\uc6b4
|
||||
windowed=\ucc3d \ubaa8\ub4dc
|
||||
yes=\ub124
|
||||
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0639\u0631\u0628\u064a\u0629)
|
||||
chinese=\u4e2d\u6587 (\u4e2d\u6587)
|
||||
dutch=Nederlands (\ub3c4\ucc99)
|
||||
english=English (\uc601\uad6d\uc5b4)
|
||||
french=Fran\u00e7ais (\ud504\ub791\uc81c\uc2a4\ucf54)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (\uac8c\uc774\uc874)
|
||||
german=Deutsch (\ub3c4\ucf54)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (\ud567\ub9ac)
|
||||
italian=Italiano (\uc774\ud0c0\ub9ac\uc5b4\ub098)
|
||||
japanese=\u65e5\u672c\u8a9e (\uc65c\uc790\ub9ac\uc5b4)
|
||||
korean=\ud55c\uad6d\uc5b4
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (\ub85c\uc6b0\uc2a4\uc544\uc774\ucf58)
|
||||
spanish=Espa\u00f1ol (\uc2a4\ud398\ub974\uc2a4\uc544\uc774\ucf58)
|
||||
@@ -7,6 +7,7 @@ connect=Verbinden
|
||||
credits=Credits
|
||||
developers=Ontwikkelaars
|
||||
fullscreen=Volledig scherm
|
||||
hint=Hint
|
||||
human=Mens
|
||||
language=Taal
|
||||
local=Lokaal
|
||||
@@ -31,10 +32,16 @@ volume=Volume
|
||||
windowed=Venstermodus
|
||||
yes=Ja
|
||||
|
||||
chinese=\u4e2d\u6587
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabisch)
|
||||
chinese=\u4e2d\u6587 (Chinees)
|
||||
dutch=Nederlands
|
||||
english=English
|
||||
french=Fran\u00e7ais
|
||||
german=Deutsch
|
||||
italian=Italiano
|
||||
spanish=Espa\u00f1ol
|
||||
english=English (Engels)
|
||||
french=Fran\u00e7ais (Frans)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (Georgisch)
|
||||
german=Deutsch (Duits)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (Hindi)
|
||||
italian=Italiano (Italiaans)
|
||||
japanese=\u65e5\u672c\u8a9e (Japans)
|
||||
korean=\ud55c\uad6d\uc5b4 (Koreaans)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russisch)
|
||||
spanish=Espa\u00f1ol (Spaans)
|
||||
@@ -0,0 +1,47 @@
|
||||
ai=\u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442
|
||||
appTitle=ISY \u0412\u044b\u0431\u043e\u0440 \u0438\u0433\u0440
|
||||
back=\u041d\u0430\u0437\u0430\u0434
|
||||
computer=\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440
|
||||
computerDifficulty=\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430
|
||||
connect=\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f
|
||||
credits=\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438
|
||||
developers=\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438
|
||||
fullscreen=\u041f\u043e\u043b\u043d\u043e\u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c
|
||||
hint=\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430
|
||||
human=\u0427\u0435\u043b\u043e\u0432\u0435\u043a
|
||||
language=\u042f\u0437\u044b\u043a
|
||||
local=\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439
|
||||
localization=\u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f
|
||||
mergeCommander=\u041a\u043e\u043c\u0430\u043d\u0434\u0435\u0440 \u0441\u043b\u0438\u044f\u043d\u0438\u044f
|
||||
moralSupport=\u041c\u043e\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430
|
||||
no=\u041d\u0435\u0442
|
||||
opengl=OpenGL
|
||||
options=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
|
||||
othello=\u041e\u0442\u0435\u043b\u043b\u043e
|
||||
playerName=\u0418\u043c\u044f \u0438\u0433\u0440\u043e\u043a\u0430
|
||||
productOwner=\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430
|
||||
quit=\u0412\u044b\u0445\u043e\u0434
|
||||
quitSure=\u0423\u0432\u0435\u0440\u0435\u043d\u044b \u043b\u0438?
|
||||
scrumMaster=\u041c\u0430\u0441\u0442\u0435\u0440 Scrum
|
||||
server=\u0421\u0435\u0440\u0432\u0435\u0440
|
||||
serverIP=\u0418\u043f\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
|
||||
serverPort=\u041f\u043e\u0440\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
|
||||
start=\u0421\u0442\u0430\u0440\u0442
|
||||
tictactoe=\u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0438
|
||||
volume=\u0413\u0440\u0430\u043c\u043c\u043e\u0444\u043e\u043d
|
||||
windowed=\u041e\u043a\u043d\u043e
|
||||
yes=\u0414\u0430
|
||||
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0410\u0440\u0430\u0431\u0441\u043a\u0438\u0439)
|
||||
chinese=\u4e2d\u6587 (\u041a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439)
|
||||
dutch=Nederlands (\u041d\u0438\u0434\u0435\u0440\u043b\u0430\u043d\u0434\u0441\u043a\u0438\u0439)
|
||||
english=English (\u0410\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439)
|
||||
french=Fran\u00e7ais (\u0424\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0439)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (\u0413\u0440\u0443\u0437\u0438\u043d\u0441\u043a\u0438\u0439)
|
||||
german=Deutsch (\u041d\u0435\u043c\u0435\u0446\u043a\u0438\u0439)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (\u0425\u0438\u043d\u0434\u0438)
|
||||
italian=Italiano (\u0418\u0442\u0430\u043b\u044c\u044f\u043d\u0441\u043a\u0438\u0439)
|
||||
japanese=\u65e5\u672c\u8a9e (\u042f\u043f\u043e\u043d\u0441\u043a\u0438\u0439)
|
||||
korean=\ud55c\uad6d\uc5b4 (\u041a\u043e\u0440\u0435\u0439\u0441\u043a\u0438\u0439)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439
|
||||
spanish=Espa\u00f1ol (\u0418\u0441\u043f\u0430\u043d\u0441\u043a\u0438\u0439)
|
||||
@@ -7,6 +7,7 @@ connect=\u8fde\u63a5
|
||||
credits=\u6b23\u8d4f
|
||||
developers=\u5f00\u53d1\u8005
|
||||
fullscreen=\u5168\u5c4f
|
||||
hint=\u63d0\u793a
|
||||
human=\u4eba
|
||||
language=\u8bed\u8a00
|
||||
local=\u672c\u5730
|
||||
@@ -31,10 +32,16 @@ volume=\u97f3\u91cf
|
||||
windowed=\u7a97\u53e3\u6a21\u5f0f
|
||||
yes=\u662f
|
||||
|
||||
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u963f\u62c9\u4f2f\u8bed)
|
||||
chinese=\u4e2d\u6587
|
||||
dutch=Nederlands
|
||||
english=English
|
||||
french=Fran\u00e7ais
|
||||
german=Deutsch
|
||||
italian=Italiano
|
||||
spanish=Espa\u00f1ol
|
||||
dutch=Nederlands (\u8377\u5170\u8bed)
|
||||
english=English (\u82f1\u8bed)
|
||||
french=Fran\u00e7ais (\u6cd5\u8bed)
|
||||
georgian=\u10e5\u10d0\u10e0\u10d4\u10e1\u10d8 (\u683c\u9c81\u5409\u4e9a\u8bed)
|
||||
german=Deutsch (\u5fb7\u8bed)
|
||||
hindi=\u0939\u093f\u0928\u094d\u0926\u0940 (\u5370\u5ea6\u8bed)
|
||||
italian=Italiano (\u610f\u5927\u5229\u8bed)
|
||||
japanese=\u65e5\u672c\u8a9e (\u65e5\u8bed)
|
||||
korean=\ud55c\uad6d\uc5b4 (\u97e9\u8bed)
|
||||
russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (\u4fc4\u8bed)
|
||||
spanish=Espa\u00f1ol (\u897f\u73ed\u7259\u8bed)
|
||||
@@ -41,7 +41,7 @@ public class SoundManager {
|
||||
.listen(this::handleMusicStart)
|
||||
.listen(this::handleVolumeChange)
|
||||
.listen(this::handleGetCurrentVolume)
|
||||
.listen(AudioEvents.clickButton.class, _ -> {
|
||||
.listen(AudioEvents.ClickButton.class, _ -> {
|
||||
try {
|
||||
playSound("medium-button-click.wav", false);
|
||||
} catch (UnsupportedAudioFileException | LineUnavailableException | IOException e) {
|
||||
@@ -69,15 +69,16 @@ public class SoundManager {
|
||||
}
|
||||
|
||||
private void handleVolumeChange(AudioEvents.ChangeVolume event) {
|
||||
if (event.newVolume() > 1.0) this.volume = 1.0;
|
||||
else this.volume = Math.max(event.newVolume(), 0.0);
|
||||
double newVolume = event.newVolume() / 100.0;
|
||||
if (newVolume > 1.0) this.volume = 1.0;
|
||||
else this.volume = Math.max(newVolume, 0.0);
|
||||
for (MediaPlayer mediaPlayer : this.activeMusic) {
|
||||
mediaPlayer.setVolume(this.volume);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleGetCurrentVolume(AudioEvents.GetCurrentVolume event) {
|
||||
new EventFlow().addPostEvent(new AudioEvents.GetCurrentVolumeReponse(volume, event.snowflakeId()))
|
||||
new EventFlow().addPostEvent(new AudioEvents.GetCurrentVolumeReponse(volume * 100.0, event.snowflakeId()))
|
||||
.asyncPostEvent();
|
||||
}
|
||||
|
||||
|
||||
@@ -37,5 +37,5 @@ public class AudioEvents extends EventsBase {
|
||||
return snowflakeId;
|
||||
}
|
||||
}
|
||||
public record clickButton() implements EventWithoutSnowflake {}
|
||||
public record ClickButton() implements EventWithoutSnowflake {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user