Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BattleshipsReloaded
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joseph.dive
BattleshipsReloaded
Commits
1710e729
Commit
1710e729
authored
Jul 30, 2019
by
jphoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hello there
parents
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
97 additions
and
0 deletions
+97
-0
.project
BattleshipsExport/.project
+11
-0
.classpath
BattleshipsExport/Battleships/.classpath
+11
-0
.project
BattleshipsExport/Battleships/.project
+17
-0
org.eclipse.jdt.core.prefs
...psExport/Battleships/.settings/org.eclipse.jdt.core.prefs
+11
-0
Main.class
BattleshipsExport/Battleships/bin/Main.class
+0
-0
Sea.class
BattleshipsExport/Battleships/bin/Sea.class
+0
-0
Ships.class
BattleshipsExport/Battleships/bin/Ships.class
+0
-0
Main.java
BattleshipsExport/Battleships/src/Main.java
+0
-0
Sea.java
BattleshipsExport/Battleships/src/Sea.java
+12
-0
Ships.java
BattleshipsExport/Battleships/src/Ships.java
+35
-0
No files found.
BattleshipsExport/.project
0 → 100644
View file @
1710e729
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
BattleshipsExport
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
BattleshipsExport/Battleships/.classpath
0 → 100644
View file @
1710e729
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"
>
<accessrules>
<accessrule
kind=
"accessible"
pattern=
"**"
/>
</accessrules>
</classpathentry>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.USER_LIBRARY/JavaFx"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
</classpath>
BattleshipsExport/Battleships/.project
0 → 100644
View file @
1710e729
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
Battleships
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.eclipse.jdt.core.javanature
</nature>
</natures>
</projectDescription>
BattleshipsExport/Battleships/.settings/org.eclipse.jdt.core.prefs
0 → 100644
View file @
1710e729
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
BattleshipsExport/Battleships/bin/Main.class
0 → 100644
View file @
1710e729
File added
BattleshipsExport/Battleships/bin/Sea.class
0 → 100644
View file @
1710e729
File added
BattleshipsExport/Battleships/bin/Ships.class
0 → 100644
View file @
1710e729
File added
BattleshipsExport/Battleships/src/Main.java
0 → 100644
View file @
1710e729
This diff is collapsed.
Click to expand it.
BattleshipsExport/Battleships/src/Sea.java
0 → 100644
View file @
1710e729
import
javafx.scene.shape.Rectangle
;
public
class
Sea
extends
Rectangle
{
int
x
;
// Each sea tile has 2 main propeties, x and y placements
int
y
;
// Other propeties will be determined in main using javafx
public
Sea
(){
}
}
BattleshipsExport/Battleships/src/Ships.java
0 → 100644
View file @
1710e729
public
class
Ships
extends
Main
{
public
int
shipType
;
// Set up variables
public
int
shipHp
;
public
boolean
shipIsVertical
=
true
;
// True for vertical, false for horizontal
// SHIP TYPES
// 1 does not exist
// 2 = Patrol boat, size 2
// 3 = Destroyer, size 3
// 4 = Battleship, size 4
// 5 = Aircraft carrier, size 5
//boolean shipIsVertical = true;
public
Ships
(
int
shipType
,
boolean
shipIsVertical
)
{
this
.
shipType
=
shipType
;
// Sets unique variable for each ship
this
.
shipIsVertical
=
shipIsVertical
;
shipHp
=
shipType
;
// Hp based on type
}
public
void
shipIsHit
()
{
int
shipHp
=
shipType
;
shipHp
=
shipHp
-
1
;
}
public
boolean
shipIsNotSunk
()
// Changed from shipSunk
{
return
shipHp
>=
0
;
// Fires if ship Hp reaches 0 (or below somehow)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment