From 95f57e1165c47514b53f3460cf493d330175a264 Mon Sep 17 00:00:00 2001 From: Katchan Date: Sat, 9 Oct 2021 12:04:24 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Add=20project=20basis.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.txt | 6 ++ src/fr/unicaen/games/Game.java | 4 ++ src/fr/unicaen/games/Weapon/Firearm.java | 18 ++++++ src/fr/unicaen/games/Weapon/Weapon.java | 8 +++ src/fr/unicaen/games/action/Action.java | 6 ++ src/fr/unicaen/games/action/DeployShield.java | 8 +++ src/fr/unicaen/games/action/DropBomb.java | 4 ++ src/fr/unicaen/games/action/DropMine.java | 4 ++ src/fr/unicaen/games/action/DropObject.java | 8 +++ src/fr/unicaen/games/action/Move.java | 8 +++ src/fr/unicaen/games/action/Nothing.java | 8 +++ src/fr/unicaen/games/action/Shot.java | 8 +++ src/fr/unicaen/games/grid/Bomb.java | 4 ++ src/fr/unicaen/games/grid/Box.java | 4 ++ src/fr/unicaen/games/grid/EnergyBall.java | 4 ++ src/fr/unicaen/games/grid/Explosive.java | 4 ++ src/fr/unicaen/games/grid/Grid.java | 12 ++++ src/fr/unicaen/games/grid/Mine.java | 4 ++ src/fr/unicaen/games/grid/Wall.java | 4 ++ .../unicaen/games/player/AbstractPlayer.java | 61 +++++++++++++++++++ .../unicaen/games/player/ComputerPlayer.java | 10 +++ src/fr/unicaen/games/player/HumanPlayer.java | 10 +++ src/fr/unicaen/games/player/Player.java | 4 ++ src/fr/unicaen/graphics/GameScrenn.java | 4 ++ src/fr/unicaen/graphics/MainMenuScrenn.java | 11 ++++ src/fr/unicaen/utils/Point.java | 46 ++++++++++++++ src/fr/unicaen/utils/Tuple.java | 57 +++++++++++++++++ 27 files changed, 329 insertions(+) create mode 100644 README.txt create mode 100644 src/fr/unicaen/games/Game.java create mode 100644 src/fr/unicaen/games/Weapon/Firearm.java create mode 100644 src/fr/unicaen/games/Weapon/Weapon.java create mode 100644 src/fr/unicaen/games/action/Action.java create mode 100644 src/fr/unicaen/games/action/DeployShield.java create mode 100644 src/fr/unicaen/games/action/DropBomb.java create mode 100644 src/fr/unicaen/games/action/DropMine.java create mode 100644 src/fr/unicaen/games/action/DropObject.java create mode 100644 src/fr/unicaen/games/action/Move.java create mode 100644 src/fr/unicaen/games/action/Nothing.java create mode 100644 src/fr/unicaen/games/action/Shot.java create mode 100644 src/fr/unicaen/games/grid/Bomb.java create mode 100644 src/fr/unicaen/games/grid/Box.java create mode 100644 src/fr/unicaen/games/grid/EnergyBall.java create mode 100644 src/fr/unicaen/games/grid/Explosive.java create mode 100644 src/fr/unicaen/games/grid/Grid.java create mode 100644 src/fr/unicaen/games/grid/Mine.java create mode 100644 src/fr/unicaen/games/grid/Wall.java create mode 100644 src/fr/unicaen/games/player/AbstractPlayer.java create mode 100644 src/fr/unicaen/games/player/ComputerPlayer.java create mode 100644 src/fr/unicaen/games/player/HumanPlayer.java create mode 100644 src/fr/unicaen/games/player/Player.java create mode 100644 src/fr/unicaen/graphics/GameScrenn.java create mode 100644 src/fr/unicaen/graphics/MainMenuScrenn.java create mode 100644 src/fr/unicaen/utils/Point.java create mode 100644 src/fr/unicaen/utils/Tuple.java diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..1970c7c --- /dev/null +++ b/README.txt @@ -0,0 +1,6 @@ +Projet de Conception Logiciel concu par : + +LUCAS Valentin +LEGOT Quentin +NEVEU Thomas + diff --git a/src/fr/unicaen/games/Game.java b/src/fr/unicaen/games/Game.java new file mode 100644 index 0000000..1aaf65f --- /dev/null +++ b/src/fr/unicaen/games/Game.java @@ -0,0 +1,4 @@ +package fr.unicaen.games; + +public class Game { +} diff --git a/src/fr/unicaen/games/Weapon/Firearm.java b/src/fr/unicaen/games/Weapon/Firearm.java new file mode 100644 index 0000000..aaea0a0 --- /dev/null +++ b/src/fr/unicaen/games/Weapon/Firearm.java @@ -0,0 +1,18 @@ +package fr.unicaen.games.Weapon; + +public class Firearm implements Weapon{ + @Override + public int getBullet() { + return 0; + } + + @Override + public int horizontalDistance() { + return 0; + } + + @Override + public int verticalDistance() { + return 0; + } +} diff --git a/src/fr/unicaen/games/Weapon/Weapon.java b/src/fr/unicaen/games/Weapon/Weapon.java new file mode 100644 index 0000000..6b59ae4 --- /dev/null +++ b/src/fr/unicaen/games/Weapon/Weapon.java @@ -0,0 +1,8 @@ +package fr.unicaen.games.Weapon; + +public interface Weapon { + + public int getBullet(); + public int horizontalDistance(); + public int verticalDistance(); +} diff --git a/src/fr/unicaen/games/action/Action.java b/src/fr/unicaen/games/action/Action.java new file mode 100644 index 0000000..42dfcdb --- /dev/null +++ b/src/fr/unicaen/games/action/Action.java @@ -0,0 +1,6 @@ +package fr.unicaen.games.action; + +public interface Action { + + public void doAction(); +} diff --git a/src/fr/unicaen/games/action/DeployShield.java b/src/fr/unicaen/games/action/DeployShield.java new file mode 100644 index 0000000..c3cd9ce --- /dev/null +++ b/src/fr/unicaen/games/action/DeployShield.java @@ -0,0 +1,8 @@ +package fr.unicaen.games.action; + +public class DeployShield implements Action{ + @Override + public void doAction() { + + } +} diff --git a/src/fr/unicaen/games/action/DropBomb.java b/src/fr/unicaen/games/action/DropBomb.java new file mode 100644 index 0000000..2a45c18 --- /dev/null +++ b/src/fr/unicaen/games/action/DropBomb.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.action; + +public class DropBomb extends DropObject{ +} diff --git a/src/fr/unicaen/games/action/DropMine.java b/src/fr/unicaen/games/action/DropMine.java new file mode 100644 index 0000000..fe905d0 --- /dev/null +++ b/src/fr/unicaen/games/action/DropMine.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.action; + +public class DropMine extends DropObject{ +} diff --git a/src/fr/unicaen/games/action/DropObject.java b/src/fr/unicaen/games/action/DropObject.java new file mode 100644 index 0000000..104b4de --- /dev/null +++ b/src/fr/unicaen/games/action/DropObject.java @@ -0,0 +1,8 @@ +package fr.unicaen.games.action; + +public class DropObject implements Action{ + @Override + public void doAction() { + + } +} diff --git a/src/fr/unicaen/games/action/Move.java b/src/fr/unicaen/games/action/Move.java new file mode 100644 index 0000000..8a7a054 --- /dev/null +++ b/src/fr/unicaen/games/action/Move.java @@ -0,0 +1,8 @@ +package fr.unicaen.games.action; + +public class Move implements Action{ + @Override + public void doAction() { + + } +} diff --git a/src/fr/unicaen/games/action/Nothing.java b/src/fr/unicaen/games/action/Nothing.java new file mode 100644 index 0000000..959cd11 --- /dev/null +++ b/src/fr/unicaen/games/action/Nothing.java @@ -0,0 +1,8 @@ +package fr.unicaen.games.action; + +public class Nothing implements Action { + @Override + public void doAction() { + + } +} diff --git a/src/fr/unicaen/games/action/Shot.java b/src/fr/unicaen/games/action/Shot.java new file mode 100644 index 0000000..870058a --- /dev/null +++ b/src/fr/unicaen/games/action/Shot.java @@ -0,0 +1,8 @@ +package fr.unicaen.games.action; + +public class Shot implements Action{ + @Override + public void doAction() { + + } +} diff --git a/src/fr/unicaen/games/grid/Bomb.java b/src/fr/unicaen/games/grid/Bomb.java new file mode 100644 index 0000000..6d29fd5 --- /dev/null +++ b/src/fr/unicaen/games/grid/Bomb.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.grid; + +public class Bomb extends Explosive{ +} diff --git a/src/fr/unicaen/games/grid/Box.java b/src/fr/unicaen/games/grid/Box.java new file mode 100644 index 0000000..4bff3d4 --- /dev/null +++ b/src/fr/unicaen/games/grid/Box.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.grid; + +public interface Box { +} diff --git a/src/fr/unicaen/games/grid/EnergyBall.java b/src/fr/unicaen/games/grid/EnergyBall.java new file mode 100644 index 0000000..af7f23d --- /dev/null +++ b/src/fr/unicaen/games/grid/EnergyBall.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.grid; + +public class EnergyBall implements Box{ +} diff --git a/src/fr/unicaen/games/grid/Explosive.java b/src/fr/unicaen/games/grid/Explosive.java new file mode 100644 index 0000000..c9440b2 --- /dev/null +++ b/src/fr/unicaen/games/grid/Explosive.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.grid; + +public class Explosive implements Box{ +} diff --git a/src/fr/unicaen/games/grid/Grid.java b/src/fr/unicaen/games/grid/Grid.java new file mode 100644 index 0000000..949a9a3 --- /dev/null +++ b/src/fr/unicaen/games/grid/Grid.java @@ -0,0 +1,12 @@ +package fr.unicaen.games.grid; + +import fr.unicaen.utils.Point; +import fr.unicaen.utils.Tuple; + +import java.util.HashMap; + +public class Grid { + + private HashMap, Tuple> board; + +} diff --git a/src/fr/unicaen/games/grid/Mine.java b/src/fr/unicaen/games/grid/Mine.java new file mode 100644 index 0000000..14b0436 --- /dev/null +++ b/src/fr/unicaen/games/grid/Mine.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.grid; + +public class Mine extends Explosive{ +} diff --git a/src/fr/unicaen/games/grid/Wall.java b/src/fr/unicaen/games/grid/Wall.java new file mode 100644 index 0000000..7832422 --- /dev/null +++ b/src/fr/unicaen/games/grid/Wall.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.grid; + +public class Wall implements Box{ +} diff --git a/src/fr/unicaen/games/player/AbstractPlayer.java b/src/fr/unicaen/games/player/AbstractPlayer.java new file mode 100644 index 0000000..7ff7751 --- /dev/null +++ b/src/fr/unicaen/games/player/AbstractPlayer.java @@ -0,0 +1,61 @@ +package fr.unicaen.games.player; + +import fr.unicaen.games.Weapon.Weapon; +import fr.unicaen.utils.Point; + +public abstract class AbstractPlayer { + + private int id; + private Point position; + private int ernergy; + private Weapon weapon; + private boolean shieldDeploy; + + public AbstractPlayer(int id, Point position, int ernergy, Weapon weapon, boolean shieldDeploy) { + this.id = id; + this.position = position; + this.ernergy = ernergy; + this.weapon = weapon; + this.shieldDeploy = shieldDeploy; + } + + public boolean isAlive(){ + return true; + } + + public int getId() { + return id; + } + + public Point getPosition() { + return position; + } + + public int getErnergy() { + return ernergy; + } + + public Weapon getWeapon() { + return weapon; + } + + public boolean isShieldDeploy() { + return shieldDeploy; + } + + public void setErnergy(int ernergy) { + this.ernergy = ernergy; + } + + public void setPosition(Point position) { + this.position = position; + } + + public void setShieldDeploy(boolean shieldDeploy) { + this.shieldDeploy = shieldDeploy; + } + + public void setWeapon(Weapon weapon) { + this.weapon = weapon; + } +} diff --git a/src/fr/unicaen/games/player/ComputerPlayer.java b/src/fr/unicaen/games/player/ComputerPlayer.java new file mode 100644 index 0000000..87159ed --- /dev/null +++ b/src/fr/unicaen/games/player/ComputerPlayer.java @@ -0,0 +1,10 @@ +package fr.unicaen.games.player; + +import fr.unicaen.games.Weapon.Weapon; +import fr.unicaen.utils.Point; + +public class ComputerPlayer extends AbstractPlayer{ + public ComputerPlayer(int id, Point position, int ernergy, Weapon weapon, boolean shieldDeploy) { + super(id, position, ernergy, weapon, shieldDeploy); + } +} diff --git a/src/fr/unicaen/games/player/HumanPlayer.java b/src/fr/unicaen/games/player/HumanPlayer.java new file mode 100644 index 0000000..f64d998 --- /dev/null +++ b/src/fr/unicaen/games/player/HumanPlayer.java @@ -0,0 +1,10 @@ +package fr.unicaen.games.player; + +import fr.unicaen.games.Weapon.Weapon; +import fr.unicaen.utils.Point; + +public class HumanPlayer extends AbstractPlayer{ + public HumanPlayer(int id, Point position, int ernergy, Weapon weapon, boolean shieldDeploy) { + super(id, position, ernergy, weapon, shieldDeploy); + } +} diff --git a/src/fr/unicaen/games/player/Player.java b/src/fr/unicaen/games/player/Player.java new file mode 100644 index 0000000..55dc691 --- /dev/null +++ b/src/fr/unicaen/games/player/Player.java @@ -0,0 +1,4 @@ +package fr.unicaen.games.player; + +public interface Player { +} diff --git a/src/fr/unicaen/graphics/GameScrenn.java b/src/fr/unicaen/graphics/GameScrenn.java new file mode 100644 index 0000000..d91c4cf --- /dev/null +++ b/src/fr/unicaen/graphics/GameScrenn.java @@ -0,0 +1,4 @@ +package fr.unicaen.graphics; + +public class GameScrenn{ +} diff --git a/src/fr/unicaen/graphics/MainMenuScrenn.java b/src/fr/unicaen/graphics/MainMenuScrenn.java new file mode 100644 index 0000000..f12bc3e --- /dev/null +++ b/src/fr/unicaen/graphics/MainMenuScrenn.java @@ -0,0 +1,11 @@ +package fr.unicaen.graphics; + +import javafx.application.Application; +import javafx.stage.Stage; + +public class MainMenuScrenn extends Application { + @Override + public void start(Stage stage) throws Exception { + + } +} diff --git a/src/fr/unicaen/utils/Point.java b/src/fr/unicaen/utils/Point.java new file mode 100644 index 0000000..bde6ca1 --- /dev/null +++ b/src/fr/unicaen/utils/Point.java @@ -0,0 +1,46 @@ +package fr.unicaen.utils; + +import java.util.Objects; + +public class Point { + + private X x; + private Y y; + public Point(X x, Y y){ + this.x = x; + this.y = y; + } + + public Point(){ + this(null, null); + } + + public X getX() { + return this.x; + } + + public Y getY() { + return y; + } + + public void setX(X x) { + this.x = x; + } + + public void setY(Y y) { + this.y = y; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Point point = (Point) o; + return Objects.equals(x, point.x) && Objects.equals(y, point.y); + } + + @Override + public int hashCode() { + return Objects.hash(x, y); + } +} diff --git a/src/fr/unicaen/utils/Tuple.java b/src/fr/unicaen/utils/Tuple.java new file mode 100644 index 0000000..0cb5fcd --- /dev/null +++ b/src/fr/unicaen/utils/Tuple.java @@ -0,0 +1,57 @@ +package fr.unicaen.utils; + +import java.util.Objects; + +public class Tuple { + + private A a; + private B b; + private C c; + + public Tuple(A a, B b, C c){ + this.a = a; + this.b = b; + this.c = c; + } + + public Tuple(){ + this(null, null, null); + } + + public A getA() { + return a; + } + + public B getB() { + return b; + } + + public C getC() { + return c; + } + + public void setA(A a) { + this.a = a; + } + + public void setB(B b) { + this.b = b; + } + + public void setC(C c) { + this.c = c; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Tuple tuple = (Tuple) o; + return Objects.equals(a, tuple.a) && Objects.equals(b, tuple.b) && Objects.equals(c, tuple.c); + } + + @Override + public int hashCode() { + return Objects.hash(a, b, c); + } +}