Skip to content
Snippets Groups Projects
Commit 5af98c5f authored by Leonard Haddad's avatar Leonard Haddad :rocket:
Browse files

Merge branch 'model' into 'master'

correct data model

See merge request reswp-2020/galaxytrucker!29
parents 67830b7b 521d2009
No related branches found
No related tags found
No related merge requests found
package com.galaxytrucker.galaxytruckerreloaded.Model.Crew;
import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.Room;
import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.System;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
......@@ -52,10 +53,15 @@ public class Crew implements Serializable {
private int[] stats;
/**
* The system this crew member is in
* The room this crew member is in
*/
@DatabaseField(foreign = true, columnName = "system")
@NonNull
private System currentSystem;
private Room currentRoom;
/**
* The user who owns this crew member
*/
@DatabaseField(columnName = "associatedUser")
private String associatedUser;
}
......@@ -96,11 +96,6 @@ public class Ship implements Serializable {
@DatabaseField(columnName = "FTLCharge")
private int FTLCharge;
/** This ship's weapons */
@NonNull
@DatabaseField(columnName = "weapons", foreign = true)
private List<Weapon> weapons;
/** This ship's systems */
@NonNull
@DatabaseField(columnName = "systems",foreign = true)
......
package com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout;
import com.badlogic.gdx.scenes.scene2d.ui.List;
import com.galaxytrucker.galaxytruckerreloaded.Model.Weapons.Weapon;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import lombok.*;
......@@ -15,4 +17,8 @@ public class WeaponSystem extends System {
@DatabaseField(columnName = "manned")
private boolean manned = false;
/** List of weapons this ship has */
@DatabaseField(foreign = true,columnName = "shipWeapons")
private List<Weapon> shipWeapons;
}
package com.galaxytrucker.galaxytruckerreloaded.Model.Weapons;
import com.galaxytrucker.galaxytruckerreloaded.Model.Ship;
import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.System;
import com.j256.ormlite.field.DatabaseField;
import lombok.*;
......@@ -93,9 +94,8 @@ public abstract class Weapon implements Serializable {
@DatabaseField(columnName = "weaponBurst")
private int burst;
/** Ship this weapon belongs to */
@NonNull
@DatabaseField(foreign = true, columnName = "associatedShip")
private Ship associatedShip;
/** Weapon system this weapon belongs to */
@DatabaseField(columnName = "weaponSystem",foreign = true)
private System weaponSystem;
}
<mxfile host="app.diagrams.net" modified="2020-05-27T15:20:21.330Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" etag="LVy6xN6CRc7D_DMOXAaF" version="13.1.2" type="device"><diagram id="eSud1R6gVXv-HQVYPhv1" name="Page-1">7V3LcuI4FP0aNlMVl9/Yy/DIpGuSSarpnu5eClDA1cZiZCch8/UjWX5g2YBjYksBWCRIyPJFPudIuroSPWO42vyJwXp5j+bQ7+nqfNMzRj1d1x1HI/9ozhvLMQzTYDkL7M1ZnpZnTLz/YJKpJrnP3hyGhYIRQn7krYuZMxQEcBYV8gDG6LVY7An5xbuuwQKWMiYz4Jdzf3jzaMlyHUvN82+ht1imd9bU5JMVSAsnGeESzNHrVpYx7hlDjFDE3q02Q+jT1kvbhV13s+PTzDAMg6jOBehx8fLXvzPz52h9//P7NRxu/tKuHFbLC/Cfky/c022f1DdYU5Ojt6Qd7H+fqZ2DFcALL+gZ1+RTc70hf9Wtv6QAfT5wE10B31sk5WbEQIjzOsi7Bf0/xPA1vRsxe53mp3lLzOcctmnbDpZ/5cOniH3o0A95K3r6IGkkWsQjbbnHpPYMCMAKskKTCHvBQowVSwh8CluhTbECm1sZ7AgjEIW5DdagZ42qLdELNugvEEcekZBrxoFRhNakWMKIEbv3AJFST34sCE8eIaoxeEJBlAigpifpG7DyfKqdt9B/gbRWSoxo5dNC2b3pDeFmpy5omdoQnYZoBSP8RookFximxS5JJPrKSbX3NRc8zU7ylkWxS4Q2EdlFVnmuQ+RNIkXvkCVXoCw9kNZ8RZj0E5JoEwhDNPNABOffQ2KwcJFY+yCA0T1Ys5K3IFzShG6DFcV5fHeCbJBR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/xmI+4G/9BA3z2F+eOHJsbvN7YjWj6XEZDr8ptlxV2+PvcpDLHyUAnsquWEY2SXbFmuXYikb7kT/HltgDTd9ty3dwoEDm7XDdot9bc47R3K0DCVI3uuhTFWvL8S73yZFybBmaYm+5NLjVdc20SMdn5q4UvZlU9y1zn+dEU7sW7nM6zsCU6TgDs7yorClKo17zk2i3RMcZpAOmFrVbhDbuOhro6GOAOD9yurCfyZalGoph5QW4W9RVR802FfqzlVk1/LFYatHv7HaqlVZ5afF0tdLa0c0K0UqrvJh12lp5oPU/qPFJEiPqwclZgsF6eY/m1FM8/h8=</diagram></mxfile>
\ No newline at end of file
<mxfile host="app.diagrams.net" modified="2020-05-28T15:03:01.607Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" etag="uBykAUA5SAm0KjsFfd0S" version="13.1.4" type="device"><diagram id="eSud1R6gVXv-HQVYPhv1" name="Page-1">7V1dd6I4GP413uw5cvgWLutHt3O23faMMzszl1GjcgaJG2hr99dvwodAQEUUEqtetCaG8Bqe50ny5k3saIPV5k8M1ssnNINuR5Vnm4427KiqalkK+UdzPqIcTdPNKGeBnVmUp6QZY+c/GGfKce6rM4N+rmCAkBs463zmFHkenAa5PIAxes8XmyM3f9c1WMBCxngK3GLuD2cWLKNcy5DT/AfoLJbJnRU5/mQFksJxhr8EM/SeydJGHW2AEQqid6vNALq09ZJ2ia673/Hp1jAMvaDKBehl8fbXv1P953D99PP7HRxs/lK6VlTLG3Bf4y/cUU2X1NdfU5ODj7gdzH9fqZ39FcALx+tod+RTfb0hf+XMX1KAPh+4CbrAdRZxuSkxEOK0DvJuQf8PMHxP7kbMXif5Sd4SszmHbcraEeV3XTgPog8t+iFrRUftx41EizikLfeY1JwBHljBqNA4wI634GPFEgKXwpZrU6zA5kEEO/wABH5qg9HvGEM+lgDfR1MHBHD23SdMOggTNWeJ+gZx4BBJu4s4OQzQmhSLGTqMLOgjUmru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TWeaBeBA+UTq4r6FUdnBMK2DpDAbnVwU7VKHuuaDf3o12ui3ZrP9rl1tHOc+l1vHTWovgXRftRp+Wae3yt4/mcbYjiWnlbMX/lHnEtRJRxFMc6WFJF4g0MsBmLYw18AzTmWZCg2ugx8SbN/bdHIZ6N49HfukE4Js/tJys4/q4l4+hRtjkHQ5AbW13Sy+Jtdg/Xa+2WTbe35j3jWi+Zi55+aGM64D/3kRz62X/K4sSxuclui1W0uudvWOy+2GJVTY+/i0EufxQAKPSu2IRBl7YrVi/GVtTaj8xxS+z5mr7dlm/hhILSpUjNPODoqHne0XkdJJUPYqzsIDlRcA1NkcyM04JZP1d0g3RteuosUeuJcc/Q9/lGFLmiNBPcgI9MsTUt4O/+erbK3MmIGzbFeFTleYX/M5yIoF/oiQh6cV1akaRaHS9P+ed2IgJDpJg4BMAs99F87sNGBk7JyK3BTqS+hFceM1c+9OjkA44Yh3YScrBVV0PWJM1ICzC3qCriiqlL9Ac5t9WwB37JeQe4XUnSzwaa4hrnhSluAvtLU1yjuKp2gYp7vtY/U+OTJEbUlZSyBIP18gnNqMt69D8=</diagram></mxfile>
\ No newline at end of file
doc/UML/Datenmodell.png

118 KiB

doc/UML/Untitled Diagram.png

118 KiB

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