586 lines
23 KiB
Java
586 lines
23 KiB
Java
package at.reisinger;
|
||
|
||
import at.reisinger.server.helper.PostgresHelper;
|
||
|
||
import java.sql.*;
|
||
import java.util.ArrayList;
|
||
import java.util.Collections;
|
||
import java.util.List;
|
||
|
||
/**
|
||
* Stellt die Verbindung zur "Datenbank" her
|
||
* Die "Datenbank" sind hier nur beispieldaten.
|
||
*/
|
||
public class DBConnection {
|
||
//private ArrayList<TradingDeal> tradingDeals;
|
||
//private ArrayList<Package> packages;
|
||
private Connection c;
|
||
private Statement stmt;
|
||
|
||
|
||
/**
|
||
* Erstellt alle Beispieldaten und simuliert somit den
|
||
* Verbindungsaufbau zu einer DB
|
||
*/
|
||
public DBConnection() {
|
||
this.c = PostgresHelper.con();
|
||
}
|
||
|
||
/**
|
||
* Erstellt alle Tabellen die für den Betrieb der Software bennötigt werden
|
||
*/
|
||
public void init() {
|
||
PostgresHelper.executeUpdateMessage("CREATE TABLE IF NOT EXISTS USERS (username TEXT PRIMARY KEY NOT NULL, nachname TEXT NOT NULL, email TEXT NOT NULL, password TEXT NOT NULL, bio TEXT, image TEXT, coins integer default 20 not null)", "User Table created");
|
||
PostgresHelper.executeUpdate("CREATE TABLE IF NOT EXISTS CARD(NAME TEXT not null,DAMAGE FLOAT not null,ELEMENTTYP TEXT not null,CARDTYPE TEXT not null, PRIMARY KEY (\"name\"));");
|
||
PostgresHelper.executeUpdateMessage("create unique index IF NOT EXISTS card_name_uindex on CARD (NAME);", "Card Table created");
|
||
PostgresHelper.executeUpdateMessage("create table IF NOT EXISTS package(\"ID\" varchar(255) not null,name varchar(255) not null constraint name references card, i serial not null constraint package_i primary key );", "Package Table created");
|
||
PostgresHelper.executeUpdateMessage("create table IF NOT EXISTS user_cards(username TEXT not null constraint user_cards_users_username_fk references users,name text not null, gesperrt boolean not null);", "UserCards Table created");
|
||
PostgresHelper.executeUpdateMessage("create table IF NOT EXISTS user_deck(username text not null constraint user_deck_users_username_fk references users,cardname text not null);", "UserDeck Table created");
|
||
PostgresHelper.executeUpdateMessage("create table IF NOT EXISTS trading(username text not null constraint trading_users_username_fk references users,id text not null constraint trading_pk primary key, cardtotrade text not null constraint trading_card_name_fk references card, mindamage float not null,reqcardtype text not null,reqelement text not null);", "Trading Table created");
|
||
}
|
||
|
||
/**
|
||
* Updated den Lock einer user card
|
||
* @param name Name der Card
|
||
* @param lock Zustand des Locks
|
||
* @return true bei erfolg, sonst false
|
||
*/
|
||
public boolean updateCardLock(String name, boolean lock){
|
||
return PostgresHelper.executeUpdate("Update user_cards set gesperrt = " + lock + " where name = \'" + name + "\';");
|
||
}
|
||
|
||
/**
|
||
* Fügt der DB einen Trading deal hinzu
|
||
* @param username User der den Trade hinzufügt
|
||
* @param id Id des Trades
|
||
* @param mindamage Min damage der für den trade benötigt wird
|
||
* @param reqcardtype Req Card Type der für den trade benötigt wird
|
||
* @param reqelement Req Element Typ der für den trade benötigt wird
|
||
* @param cardtotrade Card die zum Traden ist
|
||
* @return True bei erfolg, sonst false
|
||
*/
|
||
public boolean addTradingdeal(String username, String id, double mindamage, String reqcardtype, String reqelement, String cardtotrade){
|
||
if(PostgresHelper.executeUpdate("INSERT INTO public.trading (username, id, cardtotrade, mindamage, reqcardtype, reqelement) VALUES (\'" + username + "\',\'" + id + "\',\'" + cardtotrade + "\',\'"+ mindamage + "\',\'" + reqcardtype + "\',\'" + reqelement + "\');")){
|
||
return true;
|
||
}else{
|
||
return false;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Holt alle Trading Deals aus der DB
|
||
* @return Null bei error
|
||
*/
|
||
public ArrayList<TradingDeal> getAllTradingDeals(){
|
||
this.c = PostgresHelper.con();
|
||
ArrayList<TradingDeal> tradingDeals = new ArrayList<TradingDeal>();
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select * from trading;");
|
||
while (rs.next()) {
|
||
String username, id, cardtotrade, reqcardtype, reqelement;
|
||
int mindamage;
|
||
username = rs.getString("username");
|
||
id = rs.getString("id");
|
||
cardtotrade = rs.getString("cardtotrade");
|
||
reqcardtype = rs.getString("reqcardtype");
|
||
reqelement = rs.getString("reqelement");
|
||
mindamage = rs.getInt("mindamage");
|
||
|
||
Card card = new DBConnection().getCardFromID(cardtotrade);
|
||
if(card != null){
|
||
TradingDeal tmp = new TradingDeal(id, card, mindamage, reqcardtype +reqelement, username);
|
||
if (tmp != null){
|
||
tradingDeals.add(tmp);
|
||
System.out.println("Pulled TradingDeal");
|
||
}else{
|
||
return null;
|
||
}
|
||
}else{
|
||
return null;
|
||
}
|
||
|
||
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("Trading Deals pulled successfully");
|
||
return tradingDeals;
|
||
}
|
||
|
||
/**
|
||
* Setzt das Deck eines Users
|
||
* @param username Username von dem das Deck gesetzt werden soll
|
||
* @param deck Die ID´s des Decks in der Form einer ArrayList<String>
|
||
* @return True bei erfolg, sonst false
|
||
*/
|
||
public boolean setDeck(String username, List<String> deck){
|
||
if (!delDeck(username)){
|
||
return false;
|
||
}
|
||
Cards allCards = getCards(username);
|
||
Cards deckCards = new Cards(new ArrayList<Card>());
|
||
int count = 0;
|
||
if(allCards != null){
|
||
for (String st : deck) {
|
||
for (Card ca: allCards.getCards()) {
|
||
System.out.println("Count : " + count);
|
||
System.out.println("CA: " + ca.getName() + " st: " + st);
|
||
if(ca.getName().equals(st) && count < 4){
|
||
deckCards.addCard(ca);
|
||
if(!PostgresHelper.executeUpdateMessage("INSERT INTO public.user_deck (username, cardname) VALUES (\'"+username+"\', \'"+st+"\');", "Card #"+count+" added to Deck")){
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
count++;
|
||
}
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
|
||
/**
|
||
* Holt alle Card namen aus dem Deck eines Users
|
||
* @param username user von dem die Deck namen geholt werden soll
|
||
* @return null bedeuted error
|
||
*/
|
||
public ArrayList<String> getDeck(String username){
|
||
this.c = PostgresHelper.con();
|
||
String cardname = "";
|
||
Cards allCards = new Cards(new ArrayList<Card>());
|
||
ArrayList<String> cardnamenarray = new ArrayList<String>();
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select * from user_deck where username = \'" + username + "\';");
|
||
while (rs.next()) {
|
||
cardname = rs.getString("cardname");
|
||
cardnamenarray.add(cardname);
|
||
System.out.println("cardname = " + cardname);
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("Deck names pulled successfully");
|
||
return cardnamenarray;
|
||
}
|
||
|
||
/**
|
||
* Löscht den gesammten inhalt des Decks eines users
|
||
* @param username Username von dem das Deck gelöscht werden soll
|
||
* @return True bei erfolg, sonst false
|
||
*/
|
||
public boolean delDeck(String username){
|
||
return PostgresHelper.executeUpdateMessage("delete from user_deck where username = \'" + username + "\';", "User Deck: " + username + ", deleted");
|
||
}
|
||
|
||
|
||
/**
|
||
* Holt ein Random package aus dem Shop
|
||
*
|
||
* @param username User der das Package haben möchte
|
||
* @return Das Package aus dem Shop, null falls ein Fehler auftritt
|
||
*/
|
||
public Package userAcquirePackage(String username) {
|
||
int coins = checkCoins(username);
|
||
if (!(coins - 5 >= 0)) {
|
||
return null;
|
||
}
|
||
updateCoins(coins - 5, username);
|
||
|
||
this.c = PostgresHelper.con();
|
||
String id = "";
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select \"ID\" as id from package LIMIT 1;");
|
||
while (rs.next()) {
|
||
id = rs.getString("id");
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("Package selected successfully");
|
||
this.c = PostgresHelper.con();
|
||
String packagename = "", cardname = "", elementtyp = "", cardtype = "";
|
||
int zeilennummer = 0, damage = 0;
|
||
Cards cards = new Cards(new ArrayList<Card>());
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select i as zeilennummer, package.\"ID\" as id, package.name as packagename, c.name as cardname, c.DAMAGE as damage, c.ELEMENTTYP as elementtyp, c.CARDTYPE as cardtype from package join card c on c.name = package.name where \"ID\" = \'" + id + "\';");
|
||
int count = 0;
|
||
while (rs.next()) {
|
||
System.out.println(count++);
|
||
zeilennummer = rs.getInt("zeilennummer");
|
||
id = rs.getString("id");
|
||
packagename = rs.getString("packagename");
|
||
cardname = rs.getString("cardname");
|
||
elementtyp = rs.getString("elementtyp");
|
||
cardtype = rs.getString("cardtype");
|
||
damage = rs.getInt("damage");
|
||
Card newCard = new Card(cardname, elementtyp + cardtype, damage);
|
||
cards.addCard(newCard);
|
||
Connection b = PostgresHelper.con();
|
||
try {
|
||
stmt = b.createStatement();
|
||
String sql = "INSERT INTO public.user_cards (username, name, gesperrt) VALUES ( \'" + username + "\',\'" + newCard.getName() + "\', \'false\');";
|
||
stmt.executeUpdate(sql);
|
||
stmt.close();
|
||
b.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("User got Card successfully");
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("Package pulled successfully");
|
||
deletePackage(id);
|
||
|
||
if (cards.getCards().size() != 0 && cards != null) {
|
||
return new Package(cards, packagename, 5);
|
||
} else {
|
||
return null;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Löscht ein Package anhand des Namens
|
||
*
|
||
* @param name Name des Packages das gelöscht werden soll
|
||
* @return True bei erfolg, sonst false
|
||
*/
|
||
public boolean deletePackage(String name) {
|
||
return PostgresHelper.executeUpdateMessage("DELETE FROM package WHERE \"ID\" = \'" + name + "\';", "Package deleted successfully");
|
||
}
|
||
|
||
|
||
/**
|
||
* Coins setzten
|
||
*
|
||
* @param coins Anzahl die zu setzten ist
|
||
* @return True bei erfolg, sonst false
|
||
*/
|
||
public boolean updateCoins(int coins, String username) {
|
||
return PostgresHelper.executeUpdateMessage("UPDATE users SET coins = " + coins + " WHERE username = \'" + username + "\';", "Coins Updated");
|
||
}
|
||
|
||
/**
|
||
* Gibt die Anzahl an verfügbaren coins zurück
|
||
*
|
||
* @return Anzahl der Coins, -1 ist error
|
||
*/
|
||
public int checkCoins(String username) {
|
||
System.out.println("Check coin start");
|
||
this.c = PostgresHelper.con();
|
||
int coins = 0;
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("Select coins from users where username = \'" + username + "\';");
|
||
while (rs.next()) {
|
||
coins = rs.getInt("coins");
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.out.println("check soin error");
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return -1;
|
||
}
|
||
System.out.println("\nCoins: " + coins);
|
||
return coins;
|
||
}
|
||
|
||
/**
|
||
* Überprüft anhand des Namen der Karte, ob es schon eine solche Karte gibt
|
||
*
|
||
* @param name Name der zu prüfen ist
|
||
* @return True falls die Karte bereits existiert
|
||
*/
|
||
public boolean cardExists(String name) {
|
||
this.c = PostgresHelper.con();
|
||
int count = 0;
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select count(*) from card where name = \'" + name + "\';");
|
||
while (rs.next()) {
|
||
count = rs.getInt("count");
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
System.exit(0);
|
||
}
|
||
if (count == 1) {
|
||
return true;
|
||
} else {
|
||
return false;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Fügt eine Karte der DB hinzu
|
||
*
|
||
* @param card Card die hinzugefügt werden soll
|
||
* @return true bei erfolg, false bei error
|
||
*/
|
||
public boolean addCard(Card card) {
|
||
return PostgresHelper.executeUpdateMessage("insert into card (NAME, DAMAGE, ELEMENTTYP, CARDTYPE) values (\'" + card.getName() + "\',\'" + card.getDamage() + "\',\'" + card.getElementTyp().name() + "\',\'" + card.getCardType().name() + "\')", "Card added");
|
||
}
|
||
|
||
/**
|
||
* Ermittelt die nächste Package ID
|
||
*
|
||
* @return Die Nächste Package id, wenn 0, dann ist ein error
|
||
*/
|
||
public int nextPackageId() {
|
||
this.c = PostgresHelper.con();
|
||
String id = "";
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select max(\"ID\") from package;");
|
||
while (rs.next()) {
|
||
id = rs.getString("max");
|
||
}
|
||
if (id == null) {
|
||
id = "0";
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return 0;
|
||
}
|
||
return Integer.parseInt(id) + 1;
|
||
}
|
||
|
||
/**
|
||
* Fügt eine Package der DB hinzu,
|
||
* wenn eine Karte aus dem Package noch nicht in der Db ist,
|
||
* dann wird es automatisch hinzugefuegt
|
||
*
|
||
* @param pack Pack welches hinzugefügt werden soll
|
||
* @return True bei erfolg, false bei fehler
|
||
*/
|
||
public boolean addPackage(Package pack) {
|
||
for (Card ca : pack.getCards()) {
|
||
if (!cardExists(ca.getName())) {
|
||
if (!addCard(ca)) {
|
||
return false;
|
||
}
|
||
}
|
||
if(!PostgresHelper.executeUpdateMessage("INSERT INTO package (\"ID\", \"name\") values (\'" + pack.getName() + "\',\'" + ca.getName() + "\');", "Card zu Package hinzugefügt")){
|
||
return false;
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
|
||
/**
|
||
* Fügt einen User der DB hinzu
|
||
*
|
||
* @param username Username des Users
|
||
* @param password Passwort des Users
|
||
* @param nachname nachname des Users
|
||
* @param email Email des Users
|
||
* @return True wenn alles erfolgreich war, false wenn es nicht erfolgreich war
|
||
*/
|
||
public boolean addUser(String username, String password, String nachname, String email, String bio, String image) {
|
||
return PostgresHelper.executeUpdateMessage("INSERT INTO users (username, nachname, email, password, bio, image) values (\'" + username + "\',\'" + nachname + "\',\'" + email + "\',\'" + password + "\',\'" + bio + "\',\'" + image + "\')", "User added");
|
||
}
|
||
|
||
/**
|
||
* Updated den Nachnamen, Bio und das Image eines Users mit gegebenen usernamen
|
||
* @param username User der geändert werden soll
|
||
* @param bio Neue BIO
|
||
* @param image Neues Image
|
||
* @param name Neuer Nachname
|
||
* @return True bei erfolg, sonst false
|
||
*/
|
||
public boolean updateUser(String username, String bio, String image, String name){
|
||
System.out.println("UPDATE public.users SET nachname = \'"+ name+"\', bio = \'"+bio+"\', image = \'"+image+"\' WHERE username LIKE \'"+username+"\' ESCAPE \'#\'");
|
||
return PostgresHelper.executeUpdate("UPDATE public.users SET nachname = \'"+ name+"\', bio = \'"+bio+"\', image = \'"+image+"\' WHERE username LIKE \'"+username+"\' ESCAPE \'#\'");
|
||
}
|
||
/**
|
||
private boolean updateUser(String username, String name, String bio, String image){
|
||
return PostgresHelper.executeUpdate("UPDATE public.users SET nachname = \'"+ name +"\', bio = \'"+bio+"\', image = \'"+image+"\' WHERE username LIKE \'"+username+"\' ESCAPE \'#\'");
|
||
}
|
||
|
||
/**
|
||
* Sucht einen User anhand des Usernamens.
|
||
* Gibt ein User Objekt zurück
|
||
*
|
||
* @param uname Username der zu suchen ist
|
||
* @return User als User Objekt, null bei fehler
|
||
* @throws SQLException Fehler bei der Suche in der DB
|
||
*/
|
||
public User getUser(String uname) throws SQLException {
|
||
this.c = PostgresHelper.con();
|
||
String username = "", password = "", email = "", nachname = "", bio="", image="";
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("SELECT * FROM users where username = \'" + uname + "\';");
|
||
while (rs.next()) {
|
||
username = rs.getString("username");
|
||
nachname = rs.getString("nachname");
|
||
email = rs.getString("email");
|
||
password = rs.getString("password");
|
||
bio = rs.getString("bio");
|
||
image = rs.getString("image");
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("User pulled successfully");
|
||
return new User(new Credentials(username, password), username, username, email, new Coins(20), bio, image);
|
||
}
|
||
|
||
/**
|
||
* Holt eine Card aus der DB, anhand der gegebenen Card Id
|
||
* @param id Id der Card die geholt werden soll
|
||
* @return Null bei error
|
||
*/
|
||
public Card getCardFromID(String id){
|
||
System.out.println(id);
|
||
Connection b = PostgresHelper.con();
|
||
Card toreturn = null;
|
||
try {
|
||
stmt = b.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select * from card where NAME = \'" + id + "\';");
|
||
while (rs.next()) {
|
||
int damage =rs.getInt("damage");
|
||
String elementtyp =rs.getString("elementtyp");
|
||
String cardtype=rs.getString("cardtype");
|
||
System.out.println("damage = " + damage);
|
||
System.out.println("elementtyp = " + elementtyp);
|
||
System.out.println("cardtype = " + cardtype);
|
||
System.out.println();
|
||
toreturn = new Card(id, elementtyp+cardtype, damage);
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
b.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
if (toreturn != null){
|
||
System.out.println("Card pulled successfully");
|
||
return toreturn;
|
||
}else {
|
||
System.out.println("Card NOT pulled");
|
||
return null;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Holt alle Carten einer gegebenen Card ID List
|
||
* @param cardnamenarray Card IDs in einer Liste
|
||
* @return Falls null, dann war ein error
|
||
*/
|
||
public Cards getCardsFromIDList(List<String> cardnamenarray){
|
||
Cards allCards = new Cards(new ArrayList<Card>());
|
||
for (String st : cardnamenarray) {
|
||
Connection b = PostgresHelper.con();
|
||
try {
|
||
stmt = b.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select * from card where NAME = \'" + st + "\';");
|
||
while (rs.next()) {
|
||
int damage =rs.getInt("damage");
|
||
String elementtyp =rs.getString("elementtyp");
|
||
String cardtype=rs.getString("cardtype");
|
||
System.out.println("damage = " + damage);
|
||
System.out.println("elementtyp = " + elementtyp);
|
||
System.out.println("cardtype = " + cardtype);
|
||
System.out.println();
|
||
allCards.addCard(new Card(st, elementtyp+cardtype, damage));
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
b.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("Card pulled successfully");
|
||
}
|
||
return allCards;
|
||
}
|
||
|
||
/**
|
||
* Holt alle Karten eines Users
|
||
* @param username Username des Users
|
||
* @return Cards Object, falls es null ist, war ein fehler
|
||
*/
|
||
public Cards getCards(String username){
|
||
this.c = PostgresHelper.con();
|
||
String cardname = "";
|
||
boolean locked;
|
||
Cards allCards = new Cards(new ArrayList<Card>());
|
||
ArrayList<String> cardnamenarray = new ArrayList<String>();
|
||
try {
|
||
stmt = this.c.createStatement();
|
||
ResultSet rs = stmt.executeQuery("select * from user_cards where username = \'" + username + "\';");
|
||
while (rs.next()) {
|
||
cardname = rs.getString("name");
|
||
locked = rs.getBoolean("gesperrt");
|
||
cardnamenarray.add(cardname);
|
||
System.out.println("cardname = " + cardname);
|
||
}
|
||
rs.close();
|
||
stmt.close();
|
||
this.c.close();
|
||
} catch (Exception e) {
|
||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
||
return null;
|
||
}
|
||
System.out.println("Card Namen pulled successfully");
|
||
return getCardsFromIDList(cardnamenarray);
|
||
}
|
||
|
||
/**
|
||
* Holt alle verfügbaren TradingDeals
|
||
*
|
||
* @return Alle Trading Deals
|
||
|
||
public ArrayList<TradingDeal> getAllTradingDeals() {
|
||
return this.tradingDeals;
|
||
}
|
||
|
||
/**
|
||
* Fügt einen neuen Tradingdeal zum at.reisinger.Store hinzu
|
||
*
|
||
* @param tradingDeal Der neue Deal
|
||
|
||
public void addTradingDeal(TradingDeal tradingDeal) {
|
||
this.tradingDeals.add(tradingDeal);
|
||
}
|
||
*/
|
||
}
|