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
6293ff2f
Commit
6293ff2f
authored
8 years ago
by
Ian Prins
Browse files
Options
Downloads
Patches
Plain Diff
Implement item.h
parent
edcd55f3
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/item.h
+4
-2
4 additions, 2 deletions
src/include/item.h
src/item.cpp
+28
-0
28 additions, 0 deletions
src/item.cpp
with
32 additions
and
2 deletions
src/include/item.h
+
4
−
2
View file @
6293ff2f
...
...
@@ -9,15 +9,17 @@ class Item {
public:
enum
Location
{
OnGround
,
InPack
};
enum
Identified
{
Known
,
Unknown
};
Item
(
Location
,
Identified
,
Coord
,
std
::
string
);
Coord
getCoord
();
std
::
string
getName
();
Location
getLocation
();
Identified
isIdentified
();
bool
operator
==
(
const
Item
&
)
const
;
private
:
Coord
coord
;
std
::
string
name
;
Location
location
;
Identified
knowledge
;
Coord
coord
;
std
::
string
name
;
};
#endif
This diff is collapsed.
Click to expand it.
src/item.cpp
0 → 100644
+
28
−
0
View file @
6293ff2f
#include
"include/item.h"
Item
::
Item
(
Location
loc
,
Identified
id
,
Coord
coord
,
std
::
string
name
)
:
location
(
loc
)
,
knowledge
(
id
)
,
coord
(
coord
)
,
name
(
name
)
{}
Coord
Item
::
getCoord
()
{
return
coord
;
}
std
::
string
Item
::
getName
()
{
return
name
;
}
Item
::
Location
Item
::
getLocation
()
{
return
location
;
}
Item
::
Identified
Item
::
isIdentified
()
{
return
knowledge
;
}
bool
Item
::
operator
==
(
const
Item
&
other
)
const
{
return
this
==
&
other
;
}
\ No newline at end of file
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