Skip to content

Commit

Permalink
Merge commit '6cca9c67439a3ea6ea771b4d0839145c98c0459d' into feature/…
Browse files Browse the repository at this point in the history
…javadoc

This also means tag:pre-checkstyle-checker.xml-template of branch: feature/checkstyle-duex
The check style additions brought in will break the build when running mvn test, read Travis CI. This is the point. The build should only pass when all Javadoc checks pass. This makes for more maintainable and readable code. I am one for self documenting code, however Javadoc integration in IDEs is fucking fantastic and if this library is ever used as a 3rd party module, having the Javadocs available is invaluable.
  • Loading branch information
Peter Colapietro committed Nov 2, 2014
2 parents d9f303a + 6cca9c6 commit 1251e7d
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ build/
.classpath
.project
*.orig
*.diff
# End from pc rando
70 changes: 65 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<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>
<!-- TODO Externalize properties from all elements -->

<!-- See: http://maven.apache.org/pom.html#Developers -->
<developers>
<developer>
Expand All @@ -26,27 +27,30 @@
<timezone>-6</timezone>
</developer>
</developers>

<groupId>com.jed</groupId>
<artifactId>fuzzy-octo-shame</artifactId>
<version>0.1.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>fuzzy-octo-shame</name>
<url>https://github.com/virtuoushub/fuzzy-octo-shame</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.lwjgl.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>2.9.1</version>
<exclusions>
<!-- START Unecessary explict exclusion. Only here for verbosity. -->
<!-- START Unnecessary explicit exclusion. Only here for verbosity. -->
<exclusion>
<groupId>net.java.jinput</groupId>
<artifactId>jinput</artifactId>
</exclusion>
<!-- END Unecessary explict exclusion. Only here for verbosity. -->
<!-- END Unnecessary explicit exclusion. Only here for verbosity. -->
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -83,16 +87,17 @@
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.0-beta5</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -208,8 +213,41 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.13</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<repositories>
Expand All @@ -234,7 +272,28 @@
</pluginRepositories>
<id>bintray</id>
</profile>
<profile>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.6</version>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/bin</directory>
<followSymlinks>true</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<id>eclipse</id>
</profile>
</profiles>

<!-- TODO Add to settings file, see https://bintray.com/bintray/jcenter
<?xml version='1.0' encoding='UTF-8'?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
Expand All @@ -243,4 +302,5 @@
</activeProfiles>
</settings>
-->

</project>
2 changes: 1 addition & 1 deletion src/main/java/com/jed/state/GameMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class GameMap implements State {
public void entered() {
texture = Util.loadTexture(tileSetPath);

//TODO: this should be initialized by some data contained in the map i.e. start position or something like that...
//TODO: initialize scene Stack by some data contained in the map i.e. start position or something like that...
scene = new Stack<Entity>();
player = new Player(new Vector(50, 200), 256, 256, this);
scene.push(player);
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/jed/state/MapTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ public class MapTile extends Entity {
public boolean colliding;
public boolean evaluating;

/**
* FIXME, the parameters are too damn many.
* @param position
* @param bounds
* @param glTexX
* @param glTexY
* @param glTexWidth
* @param glTexHeight
* @param tileId
* @param map
*/
public MapTile(Vector position, Boundary bounds, float glTexX, float glTexY, float glTexWidth, float glTexHeight, int tileId, GameMap map) {
super(position, new Vector(0, 0), bounds);

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/jed/util/MapLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public static GameMap loadMap(String path) {

//Load Map properties
NodeList mapNodes = docElement.getChildNodes();
String nameNodeTextContent = null;//TODO once loop is refactored get rid of nameNodeTextContent
//FIXME this loop needs refactoring.
for (int i = 0; i < mapNodes.getLength(); i++) {
Node eachMapNode = mapNodes.item(i);
if (eachMapNode.getNodeType() == Node.ELEMENT_NODE &&
Expand All @@ -60,7 +62,8 @@ public static GameMap loadMap(String path) {
if (eachPropertyNode.getNodeType() == Node.ELEMENT_NODE &&
eachPropertyNode.getNodeName().equals("property")) {
Node nameNode = eachPropertyNode.getAttributes().getNamedItem("name");
if (nameNode != null && nameNode.getTextContent() != null && nameNode.getTextContent().equals("gravity")) {
nameNodeTextContent = nameNode.getTextContent();
if (nameNode != null && nameNodeTextContent != null && nameNodeTextContent.equals("gravity")) {
Node valueNode = eachPropertyNode.getAttributes().getNamedItem("value");
if (valueNode != null && valueNode.getTextContent() != null) {
map.gravity = Float.valueOf(valueNode.getTextContent());
Expand Down
22 changes: 22 additions & 0 deletions src/main/resources/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,29 @@
<module name="Checker">
<module name="JavadocPackage"/>
<module name="TreeWalker">
<property name="cacheFile" value="${checkstyle.cache.file}"/>

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod"/>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>

<module name="GenericWhitespace"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<!-- Configuring the check to accept lines up to 120 characters long -->
<!--
FIXME 144 is a cheat to get around checkstyle violation while I refactor com.jed.state.MapTile#MapTile
2014-11-02:15:08-06:00: fuzzy-octo-shame/src/main/java/com/jed/state/MapTile.java:33: Line is longer than 120 characters (found 144).
-->
<property name="max" value="144"/>
<!-- Configuring the check to ignore lines that begin with " * ", followed by just one word, such as within a Javadoc comment -->
<property name="ignorePattern" value="^ *\* @"/>
<property name="ignorePattern" value="^ *\* *[^ ]+$"/>
</module>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
Expand Down

0 comments on commit 1251e7d

Please sign in to comment.