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

added system service and added incombat field to ship

parent 2786393a
No related branches found
No related tags found
No related merge requests found
......@@ -111,4 +111,9 @@ public class Ship implements Serializable {
@DatabaseField(foreign = true, columnName = "inventory")
private List<Weapon> inventory;
/** Whether or not the ship is in combat */
@DatabaseField(columnName = "inCombat")
@NonNull
private boolean inCombat = false;
}
package com.galaxytrucker.galaxytruckerreloaded.Server.Services;
import com.galaxytrucker.galaxytruckerreloaded.Model.Ship;
import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.Room;
import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.System;
import com.galaxytrucker.galaxytruckerreloaded.Server.Exception.DuplicateRoomException;
import com.galaxytrucker.galaxytruckerreloaded.Server.Exception.RoomNotFoundException;
import com.galaxytrucker.galaxytruckerreloaded.Server.Persistence.RoomDAO;
import com.galaxytrucker.galaxytruckerreloaded.Server.Persistence.ShipDAO;
public class SystemService {
......@@ -13,20 +16,38 @@ public class SystemService {
private RoomDAO roomDAO;
/**
* Add a new system
* Ship DAO
*/
private ShipDAO shipDAO;
/**
* Validate system install/uninstall
*
* @param s - the command
* @return true if it is valid, else false
*/
public boolean validateSystemReplacement(String s) {
return false;
}
/**
* Install a new system on a ship
*
* @param s - the system to add
* @throws DuplicateRoomException if the system already exists
* @param ship - the ship to install the system on
* @param system - the system to install
* @param room - the room to install the system in
*/
public void addSystem(System s) throws DuplicateRoomException {
public void installSystem(Ship ship, System system, Room room) {
}
/**
* Remove a system
* Uninstall a system on a ship
*
* @param s - the system to remove
* @throws RoomNotFoundException if the system cannot be found
* @param ship - the ship to remove the system from
* @param system - the system to remove
*/
public void removeSystem(System s) throws RoomNotFoundException {
public void uninstalledSystem(Ship ship, System system) {
}
}
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