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
21ca6c12
Commit
21ca6c12
authored
5 months ago
by
Max Cherris
Browse files
Options
Downloads
Patches
Plain Diff
Update unit.hpp with required methods
parent
b8b5e5d9
Branches
Branches containing commit
No related tags found
1 merge request
!15
Merge units into main
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/unit.hpp
+23
-0
23 additions, 0 deletions
src/unit.hpp
with
23 additions
and
0 deletions
src/unit.hpp
+
23
−
0
View file @
21ca6c12
...
...
@@ -60,6 +60,29 @@ public:
void
render
(
Engine
&
engine
,
int
scale
);
/*
The attacker will move towards the defender and thus initiate combat
@params Takes a reference to the defender
Will Update the health for both units
Attacker deals damage to the defender first
*/
void
init_combat
(
Unit
&
defender
);
/*
@params Takes the desired position of the unit and updates its values
*/
void
update_position
(
int
posX
,
int
posY
);
/*
This function needs to be able to determine the possible movement-paths the unit can take
MUST take into consideration that different units behave differently on certain terrain
MUST show all movements possible
*/
void
calculate_movement
();
private:
int
x
;
int
y
;
...
...
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