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

Merge branch 'model' into 'master'

service done

See merge request reswp-2020/galaxytrucker!35
parents f38690eb bf53cb3e
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;
}
......@@ -14,43 +14,69 @@ import lombok.*;
@NoArgsConstructor(access = AccessLevel.PUBLIC)
public class PlanetEventService {
/** Type of planet event currently happening */
/**
* Type of planet event currently happening
*/
@NonNull
private Enum<PlanetEvent> currentEvent;
/** Ship DAO */
/**
* Ship DAO
*/
@NonNull
private ShipDAO shipDAO;
/** RewardService */
/**
* RewardService
*/
private RewardService rewardService;
/** Round counter (meteorShower/Nebula) */
/**
* Round counter (meteorShower/Nebula)
*/
private int roundCounter = 0;
/** Give the player some coins
* @param s - the ship to give coins to
* @param amount - amount of coins to add */
public void giveCoins(Ship s,int amount){}
/**
* Give the player some coins
*
* @param s - the ship to give coins to
* @param amount - amount of coins to add
*/
public void giveCoins(Ship s, int amount) {
}
/** Take coins away from player
* @param s - the ship to remove coins from
* @param amount - the amount of coins to remove */
public void removeCoins(Ship s,int amount){}
/**
* Take coins away from player
*
* @param s - the ship to remove coins from
* @param amount - the amount of coins to remove
*/
public void removeCoins(Ship s, int amount) {
}
/** Give the player some loot
* @param s - the ship to give the reward to
* @param dropTable - list of possible drops
* @param crewDropTable - list of possible crew drops */
public void giveLoot(Ship s, List<Weapon> dropTable, List<Crew> crewDropTable){}
/**
* Give the player some loot
*
* @param s - the ship to give the reward to
* @param dropTable - list of possible drops
* @param crewDropTable - list of possible crew drops
*/
public void giveLoot(Ship s, List<Weapon> dropTable, List<Crew> crewDropTable) {
}
/** MeteorShower damage
* @param s - the player in the meteorShower */
private void meteorShower(Ship s){}
/**
* MeteorShower damage
*
* @param s - the player in the meteorShower
*/
private void meteorShower(Ship s) {
}
/** Disable systems when in nebula
* @param s - the ship which's systems to disable */
public void disableSystemsInNebula(Ship s, int duration){}
/** Start battle */
/**
* Disable systems when in nebula
*
* @param s - the ship which's systems to disable
*/
public void disableSystemsInNebula(Ship s, int duration) {
}
}
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