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
90c8f12b
Commit
90c8f12b
authored
8 years ago
by
Ian Prins
Browse files
Options
Downloads
Patches
Plain Diff
add base class mob for players/monsters
parent
ab41faa2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/include/mob.h
+17
-0
17 additions, 0 deletions
src/include/mob.h
src/include/playerchar.h
+2
-5
2 additions, 5 deletions
src/include/playerchar.h
src/mob.cpp
+16
-0
16 additions, 0 deletions
src/mob.cpp
src/playerchar.cpp
+0
-8
0 additions, 8 deletions
src/playerchar.cpp
with
35 additions
and
13 deletions
src/include/mob.h
0 → 100644
+
17
−
0
View file @
90c8f12b
#include
"coord.h"
#include
<string>
#ifndef MOB_H
#define MOB_H
class
Mob
{
public:
Mob
(
std
::
string
,
Coord
);
Coord
getCoord
();
std
::
string
getName
();
private:
std
::
string
name
;
Coord
coord
;
};
#endif
This diff is collapsed.
Click to expand it.
src/include/playerchar.h
+
2
−
5
View file @
90c8f12b
#include
<string>
#include
"coord.h"
#include
"itemzone.h"
#include
"mob.h"
#ifndef PLAYERCHAR_H
#define PLAYERCHAR_H
class
PlayerChar
{
class
PlayerChar
:
Mob
{
public:
int
getStrength
();
int
getArmor
();
std
::
string
getName
();
int
getGold
();
int
getHP
();
int
getMaxHP
();
Coord
getCoord
();
int
getLevel
();
private:
int
HP
;
...
...
@@ -21,8 +20,6 @@ class PlayerChar {
int
armor
;
int
strength
;
int
gold
;
std
::
string
name
;
Coord
coord
;
ItemZone
backpack
;
int
level
;
};
...
...
This diff is collapsed.
Click to expand it.
src/mob.cpp
0 → 100644
+
16
−
0
View file @
90c8f12b
#include
"include/mob.h"
#include
"include/coord.h"
#include
<string>
Mob
::
Mob
(
std
::
string
name
,
Coord
coord
)
:
name
(
name
)
,
coord
(
coord
)
{}
Coord
Mob
::
getCoord
()
{
return
coord
;
}
std
::
string
Mob
::
getName
()
{
return
name
;
}
This diff is collapsed.
Click to expand it.
src/playerchar.cpp
+
0
−
8
View file @
90c8f12b
...
...
@@ -26,14 +26,6 @@ int PlayerChar::getGold() {
return
gold
;
}
std
::
string
PlayerChar
::
getName
()
{
return
name
;
}
Coord
PlayerChar
::
getCoord
()
{
return
coord
;
}
int
PlayerChar
::
getLevel
()
{
return
level
;
}
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