models and archi
This commit is contained in:
parent
43bdb74698
commit
8dca2f10c6
36 changed files with 238 additions and 1 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,2 +1,6 @@
|
|||
target/
|
||||
.idea/
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class Endpoints {
|
|||
if (name == null || name.isEmpty()) {
|
||||
return Response.status(400).build();
|
||||
}
|
||||
HelloResponse response = new HelloResponse("Hello " + name);
|
||||
HelloResponse response = new HelloResponse("hello " + name);
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package fr.epita.assistants.yakamon.data.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
@Entity @Table(name="game")
|
||||
public class GameModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY) protected Long id;
|
||||
public String map;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package fr.epita.assistants.yakamon.data.model;
|
||||
|
||||
import fr.epita.assistants.yakamon.utils.tile.ItemType;
|
||||
import jakarta.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name="item")
|
||||
public class ItemModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY) protected Integer id;
|
||||
public ItemType type;
|
||||
public Integer quantity;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package fr.epita.assistants.yakamon.data.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
@Table(name="player")
|
||||
public class PlayerModel {
|
||||
@Id @GeneratedValue(strategy = GenerationType.UUID) protected UUID id;
|
||||
public String name;
|
||||
public Integer posX;
|
||||
public Integer posY;
|
||||
public Timestamp lastMove;
|
||||
public Timestamp lastCatch;
|
||||
public Timestamp lastCollect;
|
||||
public Timestamp lastFeed;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package fr.epita.assistants.yakamon.data.model;
|
||||
|
||||
|
||||
import fr.epita.assistants.yakamon.utils.ElementType;
|
||||
import jakarta.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name="yakadex_entry")
|
||||
public class YakadexEntryModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY) protected Integer id;
|
||||
|
||||
public String name;
|
||||
public Boolean caught;
|
||||
public ElementType firstType;
|
||||
public ElementType secondType;
|
||||
public String description;
|
||||
@OneToOne @JoinColumn(name="evolution_id") public YakadexEntryModel evolutionId;
|
||||
public Integer evolveThreshold;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package fr.epita.assistants.yakamon.data.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
@Table(name="yakamon")
|
||||
public class YakamonModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID) protected UUID id;
|
||||
public String nickname;
|
||||
public Integer energyPoints;
|
||||
@ManyToOne @JoinColumn(name="yakadex_id") public YakadexEntryModel yakadexEntryId;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GetInventoryRequest {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class PlayerCatchRequest {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
import fr.epita.assistants.yakamon.utils.tile.ItemType;
|
||||
import fr.epita.assistants.yakamon.utils.tile.TerrainType;
|
||||
|
||||
public class PlayerCollectRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class PlayerInfosRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
import fr.epita.assistants.yakamon.utils.Direction;
|
||||
|
||||
public class PlayerMoveRequest {
|
||||
Direction direction;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class StartGameRequest {
|
||||
public String mapPath;
|
||||
public String playerName;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class TeamEvolveRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class TeamFeedRequest {
|
||||
public Integer quantity;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class TeamInfosRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class TeamReleaseRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class TeamRenameRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class YakadexAllInfosRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.request;
|
||||
|
||||
public class YakadexInfosRequest {
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GetInventoryResponse {
|
||||
|
||||
public class ItemType {
|
||||
public String type;
|
||||
public String value;
|
||||
}
|
||||
|
||||
public class Items {
|
||||
public ItemType itemType;
|
||||
public Integer quantity;
|
||||
}
|
||||
|
||||
List<Items> items;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class PlayerCatchResponse {
|
||||
public String uuid;
|
||||
public String nickname;
|
||||
public Integer yakadexId;
|
||||
public Integer energyPoints;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
import fr.epita.assistants.yakamon.utils.tile.ItemType;
|
||||
import fr.epita.assistants.yakamon.utils.tile.TerrainType;
|
||||
|
||||
public class PlayerCollectResponse {
|
||||
|
||||
public class TileType {
|
||||
|
||||
public class Collectible {
|
||||
ItemType type;
|
||||
String value;
|
||||
}
|
||||
|
||||
TerrainType terrainType;
|
||||
Collectible collectible;
|
||||
}
|
||||
|
||||
public TileType tileType;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class PlayerInfosResponse {
|
||||
//TODO
|
||||
// Player model
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class PlayerMoveResponse {
|
||||
public Integer posX;
|
||||
public Integer posY;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class StartGameResponse {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class TeamEvolveResponse {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class TeamFeedResponse {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class TeamInfosResponse {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class TeamReleaseResponse {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class TeamRenameResponse {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class YakadexAllInfosResponse {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package fr.epita.assistants.yakamon.presentation.api.response;
|
||||
|
||||
public class YakadexInfosResponse {
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue