-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
242 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
*.iml | ||
.idea | ||
\target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>me.tofpu</groupId> | ||
<artifactId>speedbridge-api</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>6</source> | ||
<target>6</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<java.version>1.8</java.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<repositories> | ||
<repository> | ||
<id>spigotmc-repo</id> | ||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> | ||
</repository> | ||
<repository> | ||
<id>sonatype</id> | ||
<url>https://oss.sonatype.org/content/groups/public/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot-api</artifactId> | ||
<version>1.8.8-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
37 changes: 37 additions & 0 deletions
37
api/src/main/java/me/tofpu/speedbridge/api/game/GameService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package me.tofpu.speedbridge.api.game; | ||
|
||
import me.tofpu.speedbridge.api.island.Island; | ||
import me.tofpu.speedbridge.api.island.mode.Mode; | ||
import me.tofpu.speedbridge.api.user.User; | ||
import me.tofpu.speedbridge.api.user.timer.Timer; | ||
import org.bukkit.entity.Player; | ||
|
||
public interface GameService { | ||
Result join(final Player player); | ||
|
||
Result join(final Player player, final int slot); | ||
|
||
Result join(final Player player, final Mode mode); | ||
|
||
Result join(final User user, final Island island); | ||
|
||
Result leave(final Player player); | ||
|
||
boolean isPlaying(final Player player); | ||
|
||
void addTimer(final User user); | ||
|
||
boolean hasTimer(final User user); | ||
|
||
Timer getTimer(final User user); | ||
|
||
void updateTimer(final User user); | ||
|
||
void resetTimer(final User user); | ||
|
||
void reset(final User user); | ||
|
||
void resetBlocks(final Island island); | ||
|
||
void resetIsland(final int slot); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package me.tofpu.speedbridge.api.game; | ||
|
||
public enum Result { | ||
SUCCESS, DENY, FULL, NONE, INVALID_LOBBY, INVALID_ISLAND | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
api/src/main/java/me/tofpu/speedbridge/api/island/IslandService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
api/src/main/java/me/tofpu/speedbridge/api/island/mode/Mode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package me.tofpu.speedbridge.api.island.mode; | ||
|
||
import me.tofpu.speedbridge.api.util.Identifier; | ||
|
||
import java.util.List; | ||
|
||
public interface Mode extends Identifier { | ||
/** | ||
* @return the mode initial selected slots | ||
*/ | ||
List<Integer> slots(); | ||
|
||
/** | ||
* @return true if the settings was set to this, otherwise false | ||
*/ | ||
boolean isDefault(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package me.tofpu.speedbridge.api.user; | ||
|
||
import java.util.UUID; | ||
|
||
public interface User { | ||
UUID uniqueId(); | ||
UserProperties properties(); | ||
} |
26 changes: 26 additions & 0 deletions
26
api/src/main/java/me/tofpu/speedbridge/api/user/UserProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package me.tofpu.speedbridge.api.user; | ||
|
||
import me.tofpu.speedbridge.api.user.timer.Timer; | ||
|
||
public interface UserProperties { | ||
/** | ||
* @return the player's island slot they're in, otherwise null | ||
*/ | ||
Integer islandSlot(); | ||
|
||
/** | ||
* @param slot setting the player island slot | ||
*/ | ||
void islandSlot(final Integer slot); | ||
|
||
/** | ||
* @return the player's personal best timer, otherwise null | ||
*/ | ||
Timer timer(); | ||
|
||
|
||
/** | ||
* @param timer the new personal best timer | ||
*/ | ||
void timer(final Timer timer); | ||
} |
20 changes: 20 additions & 0 deletions
20
api/src/main/java/me/tofpu/speedbridge/api/user/UserService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package me.tofpu.speedbridge.api.user; | ||
|
||
import java.io.File; | ||
import java.util.UUID; | ||
|
||
public interface UserService { | ||
User createUser(final UUID uuid); | ||
|
||
void removeUser(final User user); | ||
|
||
User getOrDefault(final UUID uuid); | ||
|
||
User searchForUUID(final UUID uuid); | ||
|
||
void saveAll(final File directory, final boolean emptyList); | ||
|
||
void save(final User user, final File directory); | ||
|
||
User load(final UUID uuid, final File directory); | ||
} |
32 changes: 32 additions & 0 deletions
32
api/src/main/java/me/tofpu/speedbridge/api/user/timer/Timer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package me.tofpu.speedbridge.api.user.timer; | ||
|
||
public interface Timer { | ||
/** | ||
* @return the island slot | ||
*/ | ||
int slot(); | ||
|
||
/** | ||
* @return the total result if the end timestamp has been provided, otherwise 0 | ||
*/ | ||
double result(); | ||
|
||
/** | ||
* The start timestamp when it has started | ||
* | ||
* @return the start timestamp | ||
*/ | ||
long start(); | ||
|
||
/** | ||
* This will set the end timestamp and provide the result | ||
* | ||
* @param end the end timestamp | ||
*/ | ||
void end(final long end); | ||
|
||
/** | ||
* @return the end timestamp | ||
*/ | ||
long end(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>me.tofpu</groupId> | ||
<artifactId>speedbridge</artifactId> | ||
<version>1.0.3</version> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>spigot</module> | ||
<module>api</module> | ||
</modules> | ||
</project> |