Skip to content

Commit

Permalink
Remove unused dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiyotoko committed Jul 5, 2023
1 parent 13f7f2c commit 26c5193
Show file tree
Hide file tree
Showing 22 changed files with 566 additions and 292 deletions.
28 changes: 4 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.scvis</groupId>
<artifactId>scvis</artifactId>
Expand All @@ -12,33 +14,12 @@
<maven.compiler.release>${project.javaVersion}</maven.compiler.release>
</properties>
<dependencies>
<!-- Annotations -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.14.1</version>
</dependency>
<!-- Logger -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.pf4j</groupId>
<artifactId>pf4j-update</artifactId>
<version>2.3.0</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -69,7 +50,6 @@
</execution>
</executions>
</plugin>
<!-- Grpc -->
</plugins>
</build>
</project>
10 changes: 10 additions & 0 deletions src/main/java/io/scvis/entity/Animation.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import javax.annotation.OverridingMethodsMustInvokeSuper;

/**
* The Animation interface represents an entity that can be animated.
*
* @author karlz
*/
public interface Animation extends Entity {

@OverridingMethodsMustInvokeSuper
Expand All @@ -10,5 +15,10 @@ default void update(double deltaT) {
animate(deltaT);
}

/**
* This method is called to perform the animation based on the elapsed time.
*
* @param deltaT The elapsed time since the last update.
*/
void animate(double deltaT);
}
12 changes: 11 additions & 1 deletion src/main/java/io/scvis/entity/Damageble.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.scvis.entity;

public interface Damageble {
/**
* The Damageble interface represents an entity that can be damaged.
*
* @author karlz
*/
public interface Damageble extends Destroyable {

/**
* This method is called to apply damage to the entity.
*
* @param damage The amount of damage to be applied.
*/
void damage(double damage);
}
2 changes: 2 additions & 0 deletions src/main/java/io/scvis/entity/Destroyable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* The Destroyable interface represents an object that can be destroyed.
*
* @author karlz
*/
public interface Destroyable {

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/scvis/entity/Parent.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* The Parent interface represents an entity that updates its childrens.
*
* @author karlz
*/
public interface Parent extends Entity {

Expand Down
57 changes: 36 additions & 21 deletions src/main/java/io/scvis/geometry/Area.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,41 @@

import javax.annotation.Nonnull;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import io.scvis.geometry.Shape.Polygon;
import io.scvis.proto.Mapper;

@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
@JsonSerialize
@JsonDeserialize
/**
* The Area class represents a 2D area defined by a collection of borders.
*
* @author karlz
* @see Border2D
*/
public final class Area implements Border2D {
@JsonProperty("outsides")
@Nonnull
private final List<? extends Border2D> outsides;
@JsonProperty("insides")
@Nonnull
private final List<? extends Border2D> insides;

@JsonCreator
public Area(@JsonProperty("outsides") List<? extends Border2D> outsides,
@JsonProperty("insides") List<? extends Border2D> insides) {
private static final long serialVersionUID = 3359561327999324550L;

private final @Nonnull List<? extends Border2D> outsides;
private final @Nonnull List<? extends Border2D> insides;

/**
* Constructs an Area object with the given outside and inside borders.
*
* @param outsides The list of outside borders.
* @param insides The list of inside borders.
*/
public Area(@Nonnull List<? extends Border2D> outsides, @Nonnull List<? extends Border2D> insides) {
this.outsides = outsides;
this.insides = insides;
}

public Area(Border2D border2D) {
outsides = List.of(border2D);
insides = List.of();
/**
* Constructs an Area object with a single border.
*
* @param border2D The single border of the area.
*/
public Area(@Nonnull Border2D border2D) {
outsides = new ArrayList<>(List.of(border2D));
insides = new ArrayList<>();
}

@Override
Expand Down Expand Up @@ -83,11 +88,21 @@ public Vector2D centroid() {
return new Polygon(centers).centroid();
}

/**
* Returns the list of outside borders of the area.
*
* @return The list of outside borders.
*/
@Nonnull
public List<? extends Border2D> getOutsides() {
return outsides;
}

/**
* Returns the list of inside borders of the area.
*
* @return The list of inside borders.
*/
@Nonnull
public List<? extends Border2D> getInsides() {
return insides;
Expand Down
22 changes: 3 additions & 19 deletions src/main/java/io/scvis/geometry/Border2D.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
package io.scvis.geometry;

import java.io.Serializable;

import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import io.scvis.geometry.Shape.Circle;
import io.scvis.geometry.Shape.Polygon;
import io.scvis.geometry.Shape.Rectangle;

/**
* The Border2D interface represents a 2D border or shape in geometry. It
* provides methods for containment, intersection, translation, rotation, and
* obtaining the centroid.
*
* @author karlz
*/
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({ @Type(value = Polygon.class, name = "Polygon"), @Type(value = Rectangle.class, name = "Rectangle"),
@Type(value = Circle.class, name = "Circle"), @Type(value = Area.class, name = "Area"),
@Type(value = Kinetic2D.class, name = "Kinetic") })
@JsonSerialize
@JsonDeserialize
public interface Border2D {
public interface Border2D extends Serializable {
/**
* Checks if the specified point is contained within the border.
*
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/io/scvis/geometry/Border3D.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
package io.scvis.geometry;

import java.io.Serializable;

import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;

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

/**
* The Border3D interface represents a 3D border or shape in geometry. It
* provides methods for containment, intersection, translation, rotation, and
* obtaining the centroid.
*
* @author karlz
*/
@JsonSerialize
@JsonDeserialize
public interface Border3D {
public interface Border3D extends Serializable {
/**
* Checks if the specified point is contained within the border.
*
Expand Down
Loading

0 comments on commit 26c5193

Please sign in to comment.