Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RogueReborn
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mikhail Andrenkov
RogueReborn
Commits
906d07aa
Commit
906d07aa
authored
8 years ago
by
Ian Prins
Browse files
Options
Downloads
Patches
Plain Diff
add constructor, inhereit publically
parent
39222d86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/include/playerchar.h
+4
-7
4 additions, 7 deletions
src/include/playerchar.h
src/playerchar.cpp
+13
-0
13 additions, 0 deletions
src/playerchar.cpp
with
17 additions
and
7 deletions
src/include/playerchar.h
+
4
−
7
View file @
906d07aa
...
...
@@ -6,8 +6,9 @@
#ifndef PLAYERCHAR_H
#define PLAYERCHAR_H
class
PlayerChar
:
Mob
{
class
PlayerChar
:
public
Mob
{
public:
PlayerChar
(
Coord
);
int
getStrength
();
int
getArmor
();
int
getGold
();
...
...
@@ -17,13 +18,9 @@ class PlayerChar : Mob {
bool
foundAmulet
();
int
maxDelved
();
private:
int
HP
;
int
maxHP
;
int
armor
;
int
strength
;
int
gold
;
const
int
START_HP
=
10
,
START_ARMOR
=
0
,
START_STR
=
1
,
START_GOLD
=
0
,
START_LEVEL
=
1
;
int
HP
,
maxHP
,
armor
,
strength
,
gold
,
level
;
ItemZone
backpack
;
int
level
;
bool
hasFoundAmulet
;
int
maxDepth
;
};
...
...
This diff is collapsed.
Click to expand it.
src/playerchar.cpp
+
13
−
0
View file @
906d07aa
...
...
@@ -3,6 +3,19 @@
#include
"include/playerchar.h"
#include
"include/coord.h"
PlayerChar
::
PlayerChar
(
Coord
pos
)
:
Mob
(
"@Rogue"
,
pos
)
,
HP
(
START_HP
)
,
maxHP
(
START_HP
)
,
armor
(
START_ARMOR
)
,
strength
(
START_STR
)
,
gold
(
START_GOLD
)
,
level
(
START_LEVEL
)
,
backpack
(
ItemZone
())
,
hasFoundAmulet
(
false
)
,
maxDepth
(
1
)
{}
int
PlayerChar
::
getHP
()
{
return
HP
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment