Merge branch 'dev/client_koppe' into 'development'

Dev/client_koppe

See merge request progproj/gruppen-ht24/Gruppe-01!1
This commit is contained in:
Hanno Fleischer
2024-11-14 18:45:24 +00:00
79 changed files with 476 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MdgaApp" type="Application" factoryName="Application" singleton="false"
nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="pp.mdga.client.MdgaApp"/>
<module name="Projekte.mdga.client.main"/>
<option name="VM_PARAMETERS" value="-Djava.util.logging.config.file=logging.properties"/>
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/>
<extension name="coverage">
<pattern>
<option name="PATTERN" value="pp.mdga.client.*"/>
<option name="ENABLED" value="true"/>
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true"/>
</method>
</configuration>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -0,0 +1,22 @@
plugins {
id 'buildlogic.jme-application-conventions'
}
description = 'mdga client'
dependencies {
implementation project(":jme-common")
implementation project(":mdga:model")
implementation libs.jme3.desktop
runtimeOnly libs.jme3.awt.dialogs
runtimeOnly libs.jme3.plugins
runtimeOnly libs.jme3.jogg
runtimeOnly libs.jme3.testdata
}
application {
mainClass = 'pp.mdga.client.MdgaApp'
applicationName = 'MDGA'
}

View File

@@ -0,0 +1,7 @@
package pp.mdga.client.Animation;
abstract class Animation {
abstract void play();
abstract void stop();
abstract boolean isOver();
}

View File

@@ -0,0 +1,29 @@
package pp.mdga.client.Animation;
import pp.mdga.client.MdgaApp;
public class AnimationHandler {
private MdgaApp app;
private Animation animation = null;
public AnimationHandler(MdgaApp app) {
this.app = app;
}
public void playAnimation(AnimationType type) {
}
public void update() {
if(null == animation) {
return;
}
if(animation.isOver()) {
animation = null;
//trigger next state
}
}
}

View File

@@ -0,0 +1,4 @@
package pp.mdga.client.Animation;
public enum AnimationType {
}

View File

@@ -0,0 +1,18 @@
package pp.mdga.client.Animation;
class EmptyAnimation extends Animation {
@Override
void play() {
//nothing
}
@Override
void stop() {
//nothing
}
@Override
boolean isOver() {
return true;
}
}

View File

@@ -0,0 +1,63 @@
package pp.mdga.client;
public enum Asset {
bigTent,
cardStack,
cir,
heer,
jet,
lw,
marine,
node_home_blue("./node_home/node_home.j3o", "./node_home/node_home_blue.png"),
node_home_black("./node_home/node_home.j3o", "./node_home/node_home_black.png"),
node_home_green("./node_home/node_home.j3o", "./node_home/node_home_green.png"),
node_home_yellow("./node_home/node_home.j3o", "./node_home/node_home_yellow.png"),
node_normal,
node_start("./node_normal/node_normal.j3o", "./node_normal/node_normal_start.png"),
node_bonus("./node_normal/node_normal.j3o", "./node_normal/node_normal_bonus.png"),
radar,
shieldCard,
ship,
smallTent,
swapCard,
tank,
turboCard,
world(1.1f);
private final String modelPath;
private final String diffPath;
private final float size;
Asset(){
String folderFileName = "./" + name() + "/" + name();
this.modelPath = folderFileName + ".j3o";
this.diffPath = folderFileName + "_diff.png";
this.size = 1f;
}
Asset(String modelPath, String diffPath){
this.modelPath = modelPath;
this.diffPath = diffPath;
this.size = 1f;
}
Asset(float size){
String folderFileName = "./" + name() + "/" + name();
this.modelPath = folderFileName + ".j3o";
this.diffPath = folderFileName + "_diff.png";
this.size = size;
}
public String getModelPath() {
return modelPath;
}
public String getDiffPath() {
return diffPath;
}
public float getSize(){
return size;
}
}

View File

@@ -0,0 +1,30 @@
package pp.mdga.client.Board;
import com.jme3.math.Vector3f;
import java.util.ArrayList;
public class BoardView {
private static final float GRID_SIZE = 10.0f;
private static final float GRID_ELEVATION = 0.0f;
private static final int GRID_EXTEND = 5;
private PileControl drawPile = new PileControl();
private PileControl discardPile = new PileControl();
private ArrayList<NodeControl> infield = new ArrayList<NodeControl>(40);
private ArrayList<PieceControl> pieces;
BoardView(int playerCount) {
assert(2 <= playerCount && playerCount <= 4);
pieces = new ArrayList<PieceControl>(4 * playerCount);
}
private static Vector3f gridToWorld(int x, int y) {
assert(-GRID_EXTEND <= x && x <= GRID_EXTEND);
assert(-GRID_EXTEND <= y && y < GRID_EXTEND);
return new Vector3f(GRID_SIZE * x, GRID_ELEVATION, GRID_SIZE * y);
}
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Board;
public class NodeControl {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Board;
public class PieceControl {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Board;
public class PileControl {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Dialog;
public class Dialog {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Dialog;
public class DialogView {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Dialog;
public class MenuDialog {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Dialog;
public class NetworkDialog {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Dialog;
public class SoundDialog {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Dialog;
public class StartDialog {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Dialog;
public class VideoDialog {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.Gui;
public class GuiView {
}

View File

@@ -0,0 +1,91 @@
package pp.mdga.client;
import com.jme3.app.SimpleApplication;
import com.jme3.renderer.RenderManager;
import pp.mdga.client.Animation.AnimationHandler;
import com.jme3.light.AmbientLight;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Spatial;
import com.jme3.shadow.DirectionalLightShadowRenderer;
import com.jme3.system.AppSettings;
public class MdgaApp extends SimpleApplication {
private AnimationHandler animationHandler;
public static void main(String[] args) {
MdgaApp app = new MdgaApp();
AppSettings settings = new AppSettings(true);
settings.setSamples(128);
settings.setCenterWindow(true);
settings.setWidth(1300);
settings.setHeight(1000);
app.setSettings(settings);
app.setShowSettings(false);
app.start();
}
@Override
public void simpleInitApp() {
animationHandler = new AnimationHandler(this);
flyCam.setEnabled(true);
int zoom = 20;
cam.setLocation(new Vector3f(zoom,0,zoom));
cam.lookAt(new Vector3f(0,0,0), new Vector3f(0,0,1));
DirectionalLight sun = new DirectionalLight();
sun.setColor(ColorRGBA.White);
sun.setDirection(new Vector3f(-1,0,-1));
rootNode.addLight(sun);
AmbientLight ambient = new AmbientLight();
ambient.setColor(new ColorRGBA(0.3f,0.3f,0.3f,1));
rootNode.addLight(ambient);
final int SHADOWMAP_SIZE=1024*8;
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 4);
dlsr.setLight(sun);
viewPort.addProcessor(dlsr);
createModel(Asset.lw).setLocalTranslation(new Vector3f(0,-10,0));
createModel(Asset.cir).setLocalTranslation(new Vector3f(0,-8,0));
createModel(Asset.marine).setLocalTranslation(new Vector3f(0,-6,0));
createModel(Asset.heer).setLocalTranslation(new Vector3f(0,-4,0));
createModel(Asset.node_normal).setLocalTranslation(new Vector3f(0,-2.5f,0));
createModel(Asset.node_home_blue).setLocalTranslation(new Vector3f(0,-1,0));
createModel(Asset.smallTent).setLocalTranslation(new Vector3f(0,1,0));
createModel(Asset.tank).setLocalTranslation(new Vector3f(0,5,0));
createModel(Asset.jet).setLocalTranslation(new Vector3f(0,12,0));
createModel(Asset.ship).setLocalTranslation(new Vector3f(0,17,0));
createModel(Asset.radar).setLocalTranslation(new Vector3f(0,20,0));
createModel(Asset.world);
//System.out.println(Asset.node_normal.getModelPath());
//System.out.println(Asset.node_normal.getDiffPath());
}
private Spatial createModel(Asset asset){
String modelName = asset.getModelPath();
String texName = asset.getDiffPath();
Spatial model = assetManager.loadModel(modelName);
model.scale(asset.getSize());
model.rotate((float) Math.toRadians(0), 0, (float) Math.toRadians(90));
model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
mat.setTexture("DiffuseMap", assetManager.loadTexture(texName));
model.setMaterial(mat);
rootNode.attachChild(model);
return model;
}
@Override
public void simpleUpdate(float tpf) {
//this method will be called every game tick and can be used to make updates
}
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client;
public class NotificationSynchronizer {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.State;
public class CeremonyState {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.State;
public class GameState {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.State;
public class LobbyState {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.State;
public class MdgaState {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.State;
public class MusicState {
}

View File

@@ -0,0 +1,5 @@
package pp.mdga.client.State;
public class SoundState {
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

View File

@@ -0,0 +1,9 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
public class ActivePlayerNotification extends Notification {
ActivePlayerNotification(Color color) {
}
}

View File

@@ -0,0 +1,10 @@
package pp.mdga.notification;
import pp.mdga.game.Card;
import pp.mdga.game.Color;
public class DrawCardNotification extends Notification {
DrawCardNotification(Color color, Card card) {
}
}

View File

@@ -0,0 +1,9 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
public class InterruptNotification extends Notification {
InterruptNotification(Color color) {
}
}

View File

@@ -0,0 +1,9 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
public class MovePieceNotification extends Notification {
MovePieceNotification(Color color, int nodeIndex) {
}
}

View File

@@ -0,0 +1,4 @@
package pp.mdga.notification;
public abstract class Notification {
}

View File

@@ -0,0 +1,11 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
import java.util.UUID;
public class PieceInGameNotification extends Notification{
PieceInGameNotification(Color color, UUID id) {
}
}

View File

@@ -0,0 +1,10 @@
package pp.mdga.notification;
import pp.mdga.game.Card;
import pp.mdga.game.Color;
public class PlayCardNotification extends Notification {
PlayCardNotification(Color color, Card card) {
}
}

View File

@@ -0,0 +1,9 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
public class PlayerInGameNotification extends Notification {
PlayerInGameNotification(Color color, String name) {
}
}

View File

@@ -0,0 +1,9 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
public class ResumeNotification extends Notification {
ResumeNotification(Color color) {
}
}

View File

@@ -0,0 +1,9 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
public class RollDiceNotification extends Notification{
RollDiceNotification(Color color, int eyes, int moveNumber) {
}
}

View File

@@ -0,0 +1,9 @@
package pp.mdga.notification;
import java.util.UUID;
public class SwapPieceNotification extends Notification {
SwapPieceNotification(UUID a, UUID b) {
assert(!a.equals(b));
}
}

View File

@@ -7,7 +7,7 @@
dependencyResolutionManagement {
versionCatalogs {
libs {
version('jme', '3.6.1-stable')
version('jme', '3.7.0-stable')
library('jme3-core', 'org.jmonkeyengine', 'jme3-core').versionRef('jme')
library('jme3-desktop', 'org.jmonkeyengine', 'jme3-desktop').versionRef('jme')
@@ -32,3 +32,8 @@
}
}
}
include 'mdga:client'
findProject(':mdga:client')?.name = 'client'
include 'mdga:client'
findProject(':mdga:client')?.name = 'client'