Skip to content
Snippets Groups Projects
Commit 2786393a authored by Leonard's avatar Leonard
Browse files

added hangar controller, added field in overworld

parent b22b963f
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,11 @@ public class Overworld implements Serializable {
@DatabaseField(columnName = "planetMap")
private HashMap<float[],Planet> planetMap;
/** The start planet */
@NonNull
@DatabaseField(columnName = "startPlanet")
private Planet startPlanet;
/** Constructor */
public Overworld(int seed) {
planetMap = new HashMap<>();
......
package com.galaxytrucker.galaxytruckerreloaded.Server.Services;
import java.util.UUID;
import com.galaxytrucker.galaxytruckerreloaded.Model.Map.Overworld;
import com.galaxytrucker.galaxytruckerreloaded.Model.Ship;
/** Handles picking a ship, creating the game map and so on */
/**
* Handles picking a ship, creating the game map and so on
*/
public class HangarService {
/** Generate a map
/**
* Generate a map
*
* @param username - the user who to generate a map for
* @param seed - seed for map generation */
public void generateMap(String username,int seed){}
* @param seed - seed for map generation
* @return the generated map
*/
public Overworld generateMap(String username, int seed) {
return null;
}
/** */
/**
* Make the user pick a ship
*
* @param username - the user who wants to pick a ship
* @param shipDesign - the ship design the user chose
* @return a new ship object for that design
*/
public Ship chooseShip(String username, String shipDesign) {
return null;
}
}
......@@ -23,7 +23,9 @@ public class RoomService {
/** Cause a breach in a room
* @param ship - the ship the breach is happening on
* @param room - the room the breach is happening in */
public void causeBreach(Ship ship,Room room){}
public void causeBreach(Ship ship,Room room){
}
/** Disable a system
* @param ship - the ship to disable a system on
......
package com.galaxytrucker.galaxytruckerreloaded.Server.Services;
import com.galaxytrucker.galaxytruckerreloaded.Model.Ship;
import com.galaxytrucker.galaxytruckerreloaded.Model.User;
import com.galaxytrucker.galaxytruckerreloaded.Server.Exception.DuplicateShipException;
import com.galaxytrucker.galaxytruckerreloaded.Server.Exception.ShipNotFoundException;
import com.galaxytrucker.galaxytruckerreloaded.Server.Exception.UserNotFoundException;
import com.galaxytrucker.galaxytruckerreloaded.Server.Persistence.ObjectDAO;
import com.galaxytrucker.galaxytruckerreloaded.Server.Persistence.ShipDAO;
import com.j256.ormlite.support.ConnectionSource;
public class ShipService {
/**
* The DAO used by the service
*/
private ShipDAO shipDAO;
/**
* Add a new ship to the database
*
* @param s - the ship to add
*
* @throws DuplicateShipException if the ship already exists in the database
*/
public void persist(Ship s) throws DuplicateShipException {
}
/** Update a ship in the database
* @param s - the ship to update \
* @throws ShipNotFoundException if the ship cannot be found in the database */
public void update(Ship s) throws ShipNotFoundException{
}
/**
* Fetch a ship from the database using the user associated to it
*
* @param u - the user associated to the ship
*
* @throws UserNotFoundException if the user cannot be found in the database
*/
public User getShipByUser(User u) throws UserNotFoundException {
return null;
}
/**
* Remove a ship from the database
*
* @param s - the ship to remove from the database
*/
public void remove(Ship s) throws ShipNotFoundException {
}
/**
* Constructor
*
* @param source - the database connection source
*/
public ShipService(ConnectionSource source) {
}
}
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