-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into mercy-limit-min
- Loading branch information
Showing
25 changed files
with
456 additions
and
97 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
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
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
37 changes: 37 additions & 0 deletions
37
core/src/main/java/tc/oc/pgm/api/map/includes/MapInclude.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 tc.oc.pgm.api.map.includes; | ||
|
||
import java.util.Collection; | ||
import org.jdom2.Content; | ||
|
||
/** Represents a snippet of XML that can be referenced for reuse * */ | ||
public interface MapInclude { | ||
|
||
/** | ||
* Get a unique id which identifies this MapInclude. | ||
* | ||
* @return A unique id | ||
*/ | ||
String getId(); | ||
|
||
/** | ||
* Get the system file time from when this MapInclude file was last modified. | ||
* | ||
* @return Time of last file modification | ||
*/ | ||
long getLastModified(); | ||
|
||
/** | ||
* Gets whether the associated {@link MapInclude} files have changed since last loading. | ||
* | ||
* @param time The current system time | ||
* @return True if given time is newer than last modified time | ||
*/ | ||
boolean hasBeenModified(long time); | ||
|
||
/** | ||
* Get a collection of {@link Content} which can be merged into an existing {@link Document} | ||
* | ||
* @return a collection of {@link Content} | ||
*/ | ||
Collection<Content> getContent(); | ||
} |
34 changes: 34 additions & 0 deletions
34
core/src/main/java/tc/oc/pgm/api/map/includes/MapIncludeProcessor.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,34 @@ | ||
package tc.oc.pgm.api.map.includes; | ||
|
||
import java.util.Collection; | ||
import org.jdom2.Document; | ||
import tc.oc.pgm.api.Config; | ||
import tc.oc.pgm.util.xml.InvalidXMLException; | ||
|
||
/** A processor to determine which {@link MapInclude}s should be included when loading a map * */ | ||
public interface MapIncludeProcessor { | ||
|
||
/** | ||
* Process the given {@link Document} and return a collection of {@link MapInclude}s. | ||
* | ||
* @param document A map document | ||
* @return A collection of map includes, collection will be empty if none are found. | ||
* @throws InvalidXMLException If the given document is not found or able to be parsed. | ||
*/ | ||
Collection<MapInclude> getMapIncludes(Document document) throws InvalidXMLException; | ||
|
||
/** | ||
* Get a {@link MapInclude} by its id | ||
* | ||
* @param includeId ID of the map include | ||
* @return A {@link MapInclude} | ||
*/ | ||
MapInclude getMapIncludeById(String includeId); | ||
|
||
/** | ||
* Reload the processor to fetch new map includes or reload existing ones. | ||
* | ||
* @param config A configuration file. | ||
*/ | ||
void reload(Config config); | ||
} |
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
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
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
Oops, something went wrong.