Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cpp-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
cpp-project
Commits
77c17106
Commit
77c17106
authored
7 months ago
by
Lorenz Martin Diel
Browse files
Options
Downloads
Patches
Plain Diff
first commit
parent
762f668a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/unit.hpp
+49
-7
49 additions, 7 deletions
src/unit.hpp
src/weapon.cpp
+0
-0
0 additions, 0 deletions
src/weapon.cpp
src/weapon.hpp
+0
-0
0 additions, 0 deletions
src/weapon.hpp
with
49 additions
and
7 deletions
src/unit.hpp
+
49
−
7
View file @
77c17106
#ifndef UNIT_HPP
#define UNIT_HPP
#include
<string>
#include
<utility>
// Enumerationen für Bewegungstyp und Waffenart
enum
class
MovementType
{
Foot
,
Tracks
,
Wheels
,
Air
,
Shipengine
};
enum
class
WeaponType
{
Gun
,
Rocket
};
// Deklaration der Unit-Klasse
class
Unit
{
public:
Unit
(
int
x
,
int
y
);
// Konstruktor
Unit
(
std
::
string
name
,
int
health
,
int
speed
,
int
attack
,
std
::
pair
<
int
,
int
>
range
,
MovementType
movement
,
WeaponType
weapon
);
// Getter-Methoden
std
::
string
getName
()
const
;
int
getHealth
()
const
;
int
getSpeed
()
const
;
int
getAttack
()
const
;
std
::
pair
<
int
,
int
>
getRange
()
const
;
MovementType
getMovementType
()
const
;
WeaponType
getWeaponType
()
const
;
int
getX
()
const
;
int
getY
()
const
;
// Setter-Methoden
void
setPosition
(
int
newX
,
int
newY
);
void
setHealth
(
int
newHealth
);
void
setSpeed
(
int
newSpeed
);
private:
// Position
int
x
;
int
y
;
// Private Membervariablen der Einheit
std
::
string
name
;
int
health
;
int
speed
;
int
attack
;
std
::
pair
<
int
,
int
>
range
;
// Angriffsreichweite
MovementType
movement
;
WeaponType
weapon
;
int
x
;
// Position auf der x-Achse
int
y
;
// Position auf der y-Achse
};
#endif
#endif
// UNIT_HPP
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/weapon.cpp
0 → 100644
+
0
−
0
View file @
77c17106
This diff is collapsed.
Click to expand it.
src/weapon.hpp
0 → 100644
+
0
−
0
View file @
77c17106
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