Skip to content
Snippets Groups Projects
Commit 2a9092ce authored by Tran Peter's avatar Tran Peter
Browse files

delete(controller): delete screen enums

parent dcb0ab89
No related branches found
No related tags found
5 merge requests!74V1,!73Initial commit,!71Merge DataBase into Development,!31Merge ui gameScene into development,!29Merge ui game scene into developmentWorking
package de.hdm_stuttgart.battlearena.Controller;
import de.hdm_stuttgart.battlearena.Controller.Utilities.ScreenClasses;
import de.hdm_stuttgart.battlearena.Controller.Utilities.ScreenDimensionCalculator;
import de.hdm_stuttgart.battlearena.Controller.Enum.GameMode;
import de.hdm_stuttgart.battlearena.Controller.Enum.GameState;
......@@ -16,11 +15,8 @@ import de.hdm_stuttgart.battlearena.Model.Map.Biom;
import de.hdm_stuttgart.battlearena.Model.Map.TileManager;
import javafx.animation.AnimationTimer;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Insets;
import javafx.geometry.Rectangle2D;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
......@@ -30,7 +26,6 @@ import javafx.scene.control.Slider;
import javafx.scene.layout.*;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Screen;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
......
package de.hdm_stuttgart.battlearena.Controller.Utilities;
public enum ScreenClasses {
// enums have a range because the screen calculations are not precise, especially with screen scaling in the OS settings
INCH27(26, 28),
INCH24(23, 25),
INCH13_SURFACE(12, 14);
final int lBound, uBound;
ScreenClasses(int lBound, int uBound) {
this.lBound = lBound;
this.uBound = uBound;
}
public static ScreenClasses inRange(int inches) {
for (ScreenClasses screens : ScreenClasses.values()) {
if (screens.isInRange(inches)) {
return screens;
}
}
return null;
}
private boolean isInRange(int inches) {
return inches >= lBound && inches <= uBound;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment