Skip to content

Commit

Permalink
hello new lib
Browse files Browse the repository at this point in the history
  • Loading branch information
ROMVoid95 committed Oct 30, 2023
1 parent 8bf05de commit fc994cb
Show file tree
Hide file tree
Showing 111 changed files with 4,345 additions and 1,437 deletions.
15 changes: 15 additions & 0 deletions HEADER
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
${project}
Copyright (C) ${year} ${organization}

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
26 changes: 23 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group 'space.tscg'
version '0.2.0'
version '1.0.0-SNAPSHOT'

tscg {
devName 'ROMVoid95'
Expand All @@ -15,11 +15,31 @@ tscg {
dependencies {
compileOnly 'io.javalin:javalin:5.6.2'
compileOnly 'com.squareup.okhttp3:okhttp:4.11.0'
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'org.tinylog:tinylog-api:2.6.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.3'
implementation 'com.rethinkdb:rethinkdb-driver:2.4.4'
implementation 'space.tscg:elitejournal4j:v37-SNAPSHOT'
compileOnly 'space.tscg:elite4j:1.0.0-SNAPSHOT'
implementation 'org.panda-lang:expressible:1.3.6'
}

javadoc.options.addStringOption('Xdoclint:none', '-quiet')

jar {
manifest {
attributes([
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'GitCommit': tscg.gitInfo().abbreviatedId,
'Git-Branch': tscg.gitInfo().branch
] as LinkedHashMap)
attributes([
'Specification-Title': 'StellarAPI',
'Specification-Vendor': 'TSCG',
'Specification-Version': '1',
'Implementation-Title': 'StellarAPI Server',
'Implementation-Version': project.version,
'Implementation-Vendor': 'StellarCartographers'
] as LinkedHashMap, 'space/tscg/')
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
signing.keyId=
signing.password=
signing.secretKeyRingFile=
signing.secretKeyRingFile=
SNAPSHOT=true
4 changes: 2 additions & 2 deletions src/main/java/space/tscg/api/Diffable.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package space.tscg.api;

import space.tscg.common.UpdatedValues;
import space.tscg.collections.DiffMap;

/**
* Classes that inherit Diffable can have another instance of their type
Expand All @@ -32,5 +32,5 @@ public interface Diffable<T> {
* @param other The same type to compare too
* @return an UpdatedValues for this type
*/
UpdatedValues diff(T other);
DiffMap diff(T other);
}
6 changes: 6 additions & 0 deletions src/main/java/space/tscg/api/JsonWrapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package space.tscg.api;

public interface JsonWrapper
{
String toJson();
}
6 changes: 6 additions & 0 deletions src/main/java/space/tscg/api/TypeBuilder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package space.tscg.api;

public interface TypeBuilder<T>
{
T build();
}
15 changes: 15 additions & 0 deletions src/main/java/space/tscg/api/carrier/ICarrierMarket.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package space.tscg.api.carrier;

import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import space.tscg.database.entity.CarrierMarket;

@JsonDeserialize(as = CarrierMarket.class)
public interface ICarrierMarket
{
List<ICarrierShip> getShips();

List<ICarrierModule> getModules();
}
31 changes: 31 additions & 0 deletions src/main/java/space/tscg/api/carrier/ICarrierModule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package space.tscg.api.carrier;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import elite.dangerous.fdevid.Outfitting.Category;
import elite.dangerous.fdevid.Outfitting.Guidance;
import elite.dangerous.fdevid.Outfitting.Mount;
import elite.dangerous.fdevid.Outfitting.Rating;
import space.tscg.database.entity.CarrierMarket.CarrierModule;

@JsonDeserialize(as = CarrierModule.class)
public interface ICarrierModule
{
int getFdevId();

Category getCategory();

String getName();

Mount getMount();

Guidance getGuidance();

int getModuleClass();

Rating getRating();

int getCost();

int getStock();
}
103 changes: 101 additions & 2 deletions src/main/java/space/tscg/api/carrier/ICarrierServices.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
package space.tscg.api.carrier;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import space.tscg.database.entity.CarrierServices;

/**
* Represents the collection of Services a FleetCarrier can have
*/
@JsonDeserialize(as = CarrierServices.class)
public interface ICarrierServices
{

Expand All @@ -12,6 +18,14 @@ public interface ICarrierServices
* @return ITaxableService
*/
ITaxableService getRefuel();

/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isRefuelInstalled();

/**
* Returns the repair Service.
Expand All @@ -20,66 +34,151 @@ public interface ICarrierServices
*/
ITaxableService getRepair();

/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isRepairInstalled();

/**
* Returns the armoury Service.
*
* @return ITaxableService
*/
ITaxableService getArmoury();

/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isArmouryInstalled();

/**
* Returns the redemption office Service.
*
* @return IService
*/
IService getRedemptionOffice();


/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isRedemptionOfficeInstalled();

/**
* Returns the shipyard Service.
*
* @return ITaxableService
*/
ITaxableService getShipyard();


/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isShipyardInstalled();

/**
* Returns the outfitting Service.
*
* @return ITaxableService
*/
ITaxableService getOutfitting();


/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isOutfittingInstalled();

/**
* Returns the secure warehouse Service.
*
* @return IService
*/
IService getSecureWarehouse();

/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isSecureWarehouseInstalled();

/**
* Returns the universal cartographics Service.
*
* @return IService
*/
IService getUniversalCartographics();


/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isUniversalCartographicsInstalled();

/**
* Returns the concourse bar Service.
*
* @return IService
*/
IService getConcourseBar();


/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isConcourseBarInstalled();

/**
* Returns the vista genomics Service.
*
* @return IService
*/
IService getVistaGenomics();


/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isVistaGenomicsInstalled();

/**
* Returns the pioneer supplies Service.
*
* @return ITaxableService
*/
ITaxableService getPioneerSupplies();


/**
* If this service is installed
*
* @return true if installed, false if not
*/
@JsonIgnore
boolean isPioneerSuppliesInstalled();
}
15 changes: 15 additions & 0 deletions src/main/java/space/tscg/api/carrier/ICarrierShip.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package space.tscg.api.carrier;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import space.tscg.database.entity.CarrierMarket.CarrierShip;

@JsonDeserialize(as = CarrierShip.class)
public interface ICarrierShip
{
int getFdevId();

String getName();

int getCost();
}
26 changes: 23 additions & 3 deletions src/main/java/space/tscg/api/carrier/IFleetCarrier.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package space.tscg.api.carrier;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import elite.dangerous.capi.modal.fleetcarrier.Orders;
import space.tscg.database.entity.FleetCarrier;

/**
* Represents very basic information about a Fleet Carrier, all implementations should be able to return
* all the information contained in this interface.
*/
@JsonDeserialize(as = FleetCarrier.class)
public interface IFleetCarrier
{
/**
* Returns the carrier's id. This is the Market ID for the carrier
*
* @return {@code Carrier ID, aka Carrier Market ID}
*/
String getCarrierId();
String getId();

/**
* Returns the Carrier's callsign.
Expand Down Expand Up @@ -42,9 +48,23 @@ public interface IFleetCarrier
int getFuel();

/**
* Returns an instance of {@link ICarrierServices}, holds all possible Services a carrier can have enabled
* Returns an instance of {@link ICarrierServices}
*
* @return the services
* @return ICarrierServices instance
*/
ICarrierServices getServices();

/**
* Returns an instance of {@link Orders}
*
* @return Orders instance
*/
Orders getOrders();

/**
* Returns an instance of {@link ICarrierMarket}
*
* @return ICarrierMarket instance
*/
ICarrierMarket getMarket();
}
Loading

0 comments on commit fc994cb

Please sign in to comment.