Change over to gradle build system
Signed-off-by: Chris Cromer <chris@cromer.cl>
4
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
/out/
|
||||
/.gradle/
|
||||
/build/
|
||||
/javadoc/
|
||||
/log/
|
||||
/lib/
|
||||
|
@ -1 +1 @@
|
||||
Azaraka
|
||||
azaraka
|
@ -1,16 +0,0 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact name="Azaraka">
|
||||
<output-path>$PROJECT_DIR$/out/artifacts/Azaraka</output-path>
|
||||
<root id="root">
|
||||
<element id="archive" name="Azaraka.jar">
|
||||
<element id="module-output" name="Azaraka" />
|
||||
</element>
|
||||
<element id="archive" name="Azaraka-javadoc.jar">
|
||||
<element id="dir-copy" path="$PROJECT_DIR$/javadoc" />
|
||||
</element>
|
||||
<element id="directory" name="lib">
|
||||
<element id="file-copy" path="$PROJECT_DIR$/lib/gson-2.8.5.jar" />
|
||||
</element>
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
@ -1,12 +0,0 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="Azaraka standalone">
|
||||
<output-path>$PROJECT_DIR$/out/artifacts/Azaraka_standalone</output-path>
|
||||
<root id="archive" name="Azaraka.jar">
|
||||
<element id="module-output" name="Azaraka" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gson-2.8.5.jar" path-in-jar="/" />
|
||||
<element id="directory" name="javadoc">
|
||||
<element id="dir-copy" path="$PROJECT_DIR$/javadoc" />
|
||||
</element>
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
17
.idea/gradle.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -1,10 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="com.google.code.gson:gson:2.8.5" type="repository">
|
||||
<properties maven-id="com.google.code.gson:gson:2.8.5" />
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/gson-2.8.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="JavadocGenerationManager">
|
||||
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/javadoc" />
|
||||
<option name="OPTION_SCOPE" value="private" />
|
||||
<option name="OPEN_IN_BROWSER" value="false" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 Oracle" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/../Azaraka/out" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8 Oracle" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/../Azaraka/Azaraka.iml" filepath="$PROJECT_DIR$/../Azaraka/Azaraka.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../Azaraka" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
20
Azaraka.iml
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<javadoc-paths>
|
||||
<root url="file://$MODULE_DIR$/javadoc" />
|
||||
</javadoc-paths>
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/doc" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/javadoc" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/lib" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/log" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="com.google.code.gson:gson:2.8.5" level="project" />
|
||||
</component>
|
||||
</module>
|
55
build.gradle
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2019 Chris Cromer
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
}
|
||||
|
||||
group 'cl.cromer.azaraka'
|
||||
version '1.0.0'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
mainClassName = "cl.cromer.azaraka.Main"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
||||
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.2'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes "Main-Class": "$mainClassName",
|
||||
'Class-Path': configurations.default.files.collect { "$it.name" }.join(' ')
|
||||
}
|
||||
|
||||
// This adds the libs into the jar
|
||||
/*from {
|
||||
configurations.default.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}*/
|
||||
}
|
||||
|
||||
task copyDependencies(type: Copy) {
|
||||
from configurations.default
|
||||
into "$buildDir/libs"
|
||||
}
|
||||
|
||||
build.dependsOn(copyDependencies)
|
||||
jar.dependsOn(copyDependencies)
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
21
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
#
|
||||
# Copyright 2019 Chris Cromer
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#
|
||||
|
||||
#Thu Oct 03 19:38:30 CLST 2019
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
172
gradlew
vendored
Executable file
@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
84
gradlew.bat
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
17
settings.gradle
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2019 Chris Cromer
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
rootProject.name = 'azaraka'
|
||||
|
@ -1,15 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: cl.cromer.azaraka.Main
|
||||
Class-Path: lib/gson-2.8.5.jar lib/junit-jupiter-5.5.2.jar lib/junit-jupiter-api-5.5
|
||||
.2.jar lib/apiguardian-api-1.1.0.jar lib/opentest4j-1.2.0.jar lib/junit-platform-co
|
||||
mmons-1.5.2.jar lib/junit-jupiter-params-5.5.2.jar lib/junit-jupiter-engine-5.5
|
||||
.2.jar lib/junit-platform-engine-1.5.2.jar
|
||||
Name: cl/cromer/game/
|
||||
Specification-Title: La Aventura de Azaraka
|
||||
Specification-Version: 1.0
|
||||
Specification-Vendor: Chris Cromer
|
||||
Implementation-Title: cl.cromer.azaraka
|
||||
Implementation-Version: build1
|
||||
Implementation-Vendor: Chris Cromer
|
||||
Name: cl/cromer/game/
|
||||
Sealed: true
|
@ -57,6 +57,7 @@ public class Celda extends JComponent implements Constantes {
|
||||
|
||||
/**
|
||||
* Initialize the cell with its coordinates
|
||||
*
|
||||
* @param xPixels The x graphical coordinate
|
||||
* @param yPixels The y graphical coordinate
|
||||
* @param x The x coordinate of the cell
|
||||
@ -135,6 +136,7 @@ public class Celda extends JComponent implements Constantes {
|
||||
|
||||
/**
|
||||
* Override the paintComponent method of JComponent to paint the cell based on type
|
||||
*
|
||||
* @param g The graphics object to paint
|
||||
*/
|
||||
@Override
|
||||
@ -144,6 +146,7 @@ public class Celda extends JComponent implements Constantes {
|
||||
|
||||
/**
|
||||
* Override the update method of JComponent to do double buffering
|
||||
*
|
||||
* @param g The graphics object to paint
|
||||
*/
|
||||
@Override
|
@ -34,35 +34,6 @@ public interface Constantes {
|
||||
* The name of the game
|
||||
*/
|
||||
String TITLE = "La Aventura de Azaraka";
|
||||
|
||||
/**
|
||||
* Get a logger object to use for debugging
|
||||
*
|
||||
* @param logClass The class that is in need of a logger
|
||||
* @param logLevel What log level to use
|
||||
* @return Returns the logger
|
||||
*/
|
||||
default Logger getLogger(Class logClass, LogLevel logLevel) {
|
||||
String className = logClass.getName();
|
||||
Logger logger;
|
||||
if (GLOBAL_LOG) {
|
||||
logger = Logger.getGlobal();
|
||||
}
|
||||
else {
|
||||
logger = Logger.getLogger(className);
|
||||
}
|
||||
if (logger.getHandlers().length == 0) {
|
||||
initializeLogger(logClass);
|
||||
}
|
||||
if (GLOBAL_LOG) {
|
||||
logger.setLevel(LogLevel.GLOBAL.getLevel());
|
||||
}
|
||||
else {
|
||||
logger.setLevel(logLevel.getLevel());
|
||||
}
|
||||
return logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use a global log if true or individual logs if false
|
||||
*/
|
||||
@ -144,6 +115,34 @@ public interface Constantes {
|
||||
*/
|
||||
Font FONT = new Font("monospaced", Font.PLAIN, FONT_SIZE);
|
||||
|
||||
/**
|
||||
* Get a logger object to use for debugging
|
||||
*
|
||||
* @param logClass The class that is in need of a logger
|
||||
* @param logLevel What log level to use
|
||||
* @return Returns the logger
|
||||
*/
|
||||
default Logger getLogger(Class logClass, LogLevel logLevel) {
|
||||
String className = logClass.getName();
|
||||
Logger logger;
|
||||
if (GLOBAL_LOG) {
|
||||
logger = Logger.getGlobal();
|
||||
}
|
||||
else {
|
||||
logger = Logger.getLogger(className);
|
||||
}
|
||||
if (logger.getHandlers().length == 0) {
|
||||
initializeLogger(logClass);
|
||||
}
|
||||
if (GLOBAL_LOG) {
|
||||
logger.setLevel(LogLevel.GLOBAL.getLevel());
|
||||
}
|
||||
else {
|
||||
logger.setLevel(logLevel.getLevel());
|
||||
}
|
||||
return logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random number between given min and max
|
||||
*
|
@ -55,6 +55,10 @@ public class Escenario extends JComponent implements Constantes {
|
||||
* The cells of the game
|
||||
*/
|
||||
private final Celda[][] celdas;
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
private final Logger logger;
|
||||
/**
|
||||
* A collection of tiles that can be used in the scene
|
||||
*/
|
||||
@ -63,10 +67,6 @@ public class Escenario extends JComponent implements Constantes {
|
||||
* Whether or not the door is closed yet
|
||||
*/
|
||||
private boolean doorClosed = false;
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
private final Logger logger;
|
||||
|
||||
/**
|
||||
* Initialize the scene
|
||||
@ -463,6 +463,7 @@ public class Escenario extends JComponent implements Constantes {
|
||||
|
||||
/**
|
||||
* Get the parent canvas of this scene
|
||||
*
|
||||
* @return Returns the parent canvas
|
||||
*/
|
||||
public Lienzo getCanvas() {
|
@ -40,22 +40,10 @@ public class Lienzo extends Canvas implements Constantes {
|
||||
* The game scene
|
||||
*/
|
||||
private final Escenario escenario;
|
||||
/**
|
||||
* The graphics buffer
|
||||
*/
|
||||
private Graphics graphicBuffer;
|
||||
/**
|
||||
* The image buffer
|
||||
*/
|
||||
private Image imageBuffer;
|
||||
/**
|
||||
* The threads for the objects
|
||||
*/
|
||||
private final HashMap<Object, Thread> threads = new HashMap<>();
|
||||
/**
|
||||
* The player
|
||||
*/
|
||||
private Player player;
|
||||
/**
|
||||
* The enemies
|
||||
*/
|
||||
@ -68,10 +56,6 @@ public class Lienzo extends Canvas implements Constantes {
|
||||
* The chests
|
||||
*/
|
||||
private final ArrayList<Chest> chests = new ArrayList<>();
|
||||
/**
|
||||
* The magic portal
|
||||
*/
|
||||
private Portal portal;
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
@ -80,6 +64,22 @@ public class Lienzo extends Canvas implements Constantes {
|
||||
* The game over animation
|
||||
*/
|
||||
private final Animation gameOverAnimation;
|
||||
/**
|
||||
* The graphics buffer
|
||||
*/
|
||||
private Graphics graphicBuffer;
|
||||
/**
|
||||
* The image buffer
|
||||
*/
|
||||
private Image imageBuffer;
|
||||
/**
|
||||
* The player
|
||||
*/
|
||||
private Player player;
|
||||
/**
|
||||
* The magic portal
|
||||
*/
|
||||
private Portal portal;
|
||||
/**
|
||||
* The hearts animation
|
||||
*/
|
||||
@ -196,6 +196,7 @@ public class Lienzo extends Canvas implements Constantes {
|
||||
|
||||
/**
|
||||
* Override the paint method of Canvas to paint all the scene components
|
||||
*
|
||||
* @param g The graphics object to paint
|
||||
*/
|
||||
@Override
|
@ -37,9 +37,10 @@ public class Main implements Constantes {
|
||||
|
||||
/**
|
||||
* Open the main window
|
||||
*
|
||||
* @param args The arguments passed to the application
|
||||
*/
|
||||
public static void main (String[]args) {
|
||||
public static void main(String[] args) {
|
||||
new Main();
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public class Chest extends Object implements Constantes {
|
||||
|
||||
/**
|
||||
* Initialize the chest
|
||||
*
|
||||
* @param escenario The scene the chest is in
|
||||
* @param celda The cell that contains the chest
|
||||
*/
|
||||
@ -91,19 +92,6 @@ public class Chest extends Object implements Constantes {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Play the chest opening sound
|
||||
*/
|
||||
private void playChestOpenSound() {
|
||||
try {
|
||||
sound.setVolume(getEscenario().getCanvas().getVolume());
|
||||
sound.play();
|
||||
}
|
||||
catch (SoundException e) {
|
||||
getLogger().warning(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the state of the chest
|
||||
*
|
||||
@ -130,6 +118,19 @@ public class Chest extends Object implements Constantes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Play the chest opening sound
|
||||
*/
|
||||
private void playChestOpenSound() {
|
||||
try {
|
||||
sound.setVolume(getEscenario().getCanvas().getVolume());
|
||||
sound.play();
|
||||
}
|
||||
catch (SoundException e) {
|
||||
getLogger().warning(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Animate the chest opening
|
||||
*/
|
@ -30,6 +30,10 @@ import java.util.concurrent.locks.Lock;
|
||||
* This class handles the enemy object
|
||||
*/
|
||||
public class Enemy extends Object implements Constantes {
|
||||
/**
|
||||
* The lock helps prevent race conditions when checking positioning
|
||||
*/
|
||||
private final Lock lock;
|
||||
/**
|
||||
* The current direction the enemy is facing
|
||||
*/
|
||||
@ -38,10 +42,6 @@ public class Enemy extends Object implements Constantes {
|
||||
* The speed of the enemy
|
||||
*/
|
||||
private int speed = 500;
|
||||
/**
|
||||
* The lock helps prevent race conditions when checking positioning
|
||||
*/
|
||||
private final Lock lock;
|
||||
/**
|
||||
* The enemy attack sound
|
||||
*/
|
@ -27,6 +27,16 @@ public class Gem extends Object {
|
||||
*/
|
||||
private State state = State.TAINTED;
|
||||
|
||||
/**
|
||||
* Initialize the gem object
|
||||
*
|
||||
* @param escenario The scene the gem is in
|
||||
* @param celda The cell the gem is in
|
||||
*/
|
||||
public Gem(Escenario escenario, Celda celda) {
|
||||
super(escenario, celda);
|
||||
}
|
||||
|
||||
/**
|
||||
* The possible states of the gem
|
||||
*/
|
||||
@ -40,14 +50,4 @@ public class Gem extends Object {
|
||||
*/
|
||||
PURIFIED
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the gem object
|
||||
*
|
||||
* @param escenario The scene the gem is in
|
||||
* @param celda The cell the gem is in
|
||||
*/
|
||||
public Gem(Escenario escenario, Celda celda) {
|
||||
super(escenario, celda);
|
||||
}
|
||||
}
|
@ -29,6 +29,10 @@ import java.util.logging.Logger;
|
||||
* All game objects extend this class
|
||||
*/
|
||||
public class Object implements Runnable {
|
||||
/**
|
||||
* The scene the object is in
|
||||
*/
|
||||
private final Escenario escenario;
|
||||
/**
|
||||
* The current x position of the object
|
||||
*/
|
||||
@ -37,10 +41,6 @@ public class Object implements Runnable {
|
||||
* The current y position of the object
|
||||
*/
|
||||
private int y;
|
||||
/**
|
||||
* The scene the object is in
|
||||
*/
|
||||
private final Escenario escenario;
|
||||
/**
|
||||
* The cell the object is in
|
||||
*/
|
||||
@ -129,6 +129,15 @@ public class Object implements Runnable {
|
||||
return celda;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cell the object is in
|
||||
*
|
||||
* @param celda The cell
|
||||
*/
|
||||
protected void setCelda(Celda celda) {
|
||||
this.celda = celda;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current animation
|
||||
*
|
||||
@ -212,15 +221,6 @@ public class Object implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cell the object is in
|
||||
*
|
||||
* @param celda The cell
|
||||
*/
|
||||
protected void setCelda(Celda celda) {
|
||||
this.celda = celda;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the logger
|
||||
*
|
@ -32,14 +32,14 @@ public class Player extends Object implements Constantes {
|
||||
* The maximum health of the player
|
||||
*/
|
||||
public final static int MAX_HEALTH = 8;
|
||||
/**
|
||||
* The current health of the player
|
||||
*/
|
||||
private int health = MAX_HEALTH;
|
||||
/**
|
||||
* Objects that the player is carrying
|
||||
*/
|
||||
private final ArrayList<Object> carrying = new ArrayList<>();
|
||||
/**
|
||||
* The current health of the player
|
||||
*/
|
||||
private int health = MAX_HEALTH;
|
||||
|
||||
/**
|
||||
* Initialize the player
|
@ -27,10 +27,6 @@ import java.util.logging.Logger;
|
||||
* This class handles sound
|
||||
*/
|
||||
public class Sound implements Constantes {
|
||||
/**
|
||||
* The sound clip to play
|
||||
*/
|
||||
private Clip sound;
|
||||
/**
|
||||
* The path to the sound
|
||||
*/
|
||||
@ -39,6 +35,10 @@ public class Sound implements Constantes {
|
||||
* The logger
|
||||
*/
|
||||
private final Logger logger;
|
||||
/**
|
||||
* The sound clip to play
|
||||
*/
|
||||
private Clip sound;
|
||||
|
||||
/**
|
||||
* Load the sound
|
||||
@ -71,6 +71,7 @@ public class Sound implements Constantes {
|
||||
|
||||
/**
|
||||
* Play the sound
|
||||
*
|
||||
* @throws SoundException Thrown if the sound clip is null
|
||||
*/
|
||||
public void play() throws SoundException {
|
||||
@ -104,6 +105,7 @@ public class Sound implements Constantes {
|
||||
|
||||
/**
|
||||
* Stop the sound
|
||||
*
|
||||
* @throws SoundException Thrown if the sound clip is null
|
||||
*/
|
||||
public void stop() throws SoundException {
|
||||
@ -119,6 +121,7 @@ public class Sound implements Constantes {
|
||||
|
||||
/**
|
||||
* Set the number of loops to play
|
||||
*
|
||||
* @param loops The number of loops, should be n-1
|
||||
* @throws SoundException Thrown if the sound is null
|
||||
*/
|
@ -29,6 +29,14 @@ import java.util.logging.Logger;
|
||||
* This class handles loading the images and animating the sprite
|
||||
*/
|
||||
public class Animation implements Cloneable, Constantes {
|
||||
/**
|
||||
* The collection of all the images that make up the object
|
||||
*/
|
||||
private final HashMap<Direction, ArrayList<BufferedImage>> imageHash;
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
private final Logger logger;
|
||||
/**
|
||||
* The current frame the sprite should be showing
|
||||
*/
|
||||
@ -45,14 +53,6 @@ public class Animation implements Cloneable, Constantes {
|
||||
* The direction of the image to show
|
||||
*/
|
||||
private Direction currentDirection = Direction.NONE;
|
||||
/**
|
||||
* The collection of all the images that make up the object
|
||||
*/
|
||||
private final HashMap<Direction, ArrayList<BufferedImage>> imageHash;
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
private final Logger logger;
|
||||
|
||||
/**
|
||||
* Initialize the sprite
|
@ -63,8 +63,8 @@ public class Sheet implements Constantes {
|
||||
/**
|
||||
* Returns the selected texture
|
||||
*
|
||||
* @return Returns the current texture
|
||||
* @param textureNumber The texture to get from the collection
|
||||
* @return Returns the current texture
|
||||
* @throws SheetException Thrown when there are no images in the texture collection
|
||||
*/
|
||||
public BufferedImage getTexture(int textureNumber) throws SheetException {
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 225 KiB After Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 888 B After Width: | Height: | Size: 888 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 917 B After Width: | Height: | Size: 917 B |
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 223 KiB After Width: | Height: | Size: 223 KiB |
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 159 KiB |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
Before Width: | Height: | Size: 465 B After Width: | Height: | Size: 465 B |
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 573 B |
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 693 B |
Before Width: | Height: | Size: 695 B After Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 759 B |