Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
COO-beat-them-all
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Guillaume DEWISME
COO-beat-them-all
Commits
40921cc6
Commit
40921cc6
authored
Nov 19, 2024
by
Guillaume Dewisme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix/endurance not abstract
parent
5f9d3f98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
Entity.java
src/main/java/org/example/Entity.java
+0
-13
Player.java
src/main/java/org/example/Player.java
+8
-0
No files found.
src/main/java/org/example/Entity.java
View file @
40921cc6
...
@@ -4,12 +4,6 @@ public abstract class Entity {
...
@@ -4,12 +4,6 @@ public abstract class Entity {
private
int
damage
;
private
int
damage
;
private
int
pvMax
;
private
int
pvMax
;
private
int
pv
;
private
int
pv
;
private
int
endurance
;
private
static
final
int
MAX_ENDURANCE
=
3
;
public
Entity
(){
this
.
endurance
=
MAX_ENDURANCE
;
}
public
void
heal
(){
public
void
heal
(){
...
@@ -40,13 +34,6 @@ public abstract class Entity {
...
@@ -40,13 +34,6 @@ public abstract class Entity {
this
.
pv
=
pv
;
this
.
pv
=
pv
;
}
}
public
int
getEndurance
()
{
return
this
.
endurance
;
}
public
void
setEndurance
(
int
endurance
)
{
this
.
endurance
=
endurance
;
}
public
boolean
isAlive
(){
public
boolean
isAlive
(){
return
(
this
.
pv
>
0
);
return
(
this
.
pv
>
0
);
...
...
src/main/java/org/example/Player.java
View file @
40921cc6
...
@@ -3,15 +3,23 @@ package org.example;
...
@@ -3,15 +3,23 @@ package org.example;
public
class
Player
extends
Entity
{
public
class
Player
extends
Entity
{
private
String
name
;
private
String
name
;
private
SpecialAbility
specialAbility
;
private
SpecialAbility
specialAbility
;
private
int
endurance
;
private
static
final
int
MAX_ENDURANCE
=
3
;
public
Player
(
String
name
,
SpecialAbility
specialAbility
)
{
public
Player
(
String
name
,
SpecialAbility
specialAbility
)
{
super
();
super
();
this
.
name
=
name
;
this
.
name
=
name
;
this
.
specialAbility
=
specialAbility
;
this
.
specialAbility
=
specialAbility
;
this
.
endurance
=
MAX_ENDURANCE
;
this
.
setPvMax
(
100
);
this
.
setPvMax
(
100
);
this
.
setPv
(
this
.
getPvMax
());
this
.
setPv
(
this
.
getPvMax
());
this
.
setDamage
(
5
);
this
.
setDamage
(
5
);
}
}
public
void
attackEnnemy
(){
--
this
.
endurance
;
//implement when Ennemy class is created
}
}
}
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