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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
cpp-project
Commits
cb3ef2d2
Commit
cb3ef2d2
authored
4 months ago
by
Max Cherris
Browse files
Options
Downloads
Patches
Plain Diff
Update Building.hpp with descriptions of the necessary functions
parent
056d60f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/building.hpp
+62
-5
62 additions, 5 deletions
src/building.hpp
with
62 additions
and
5 deletions
src/building.hpp
+
62
−
5
View file @
cb3ef2d2
...
...
@@ -45,24 +45,81 @@ class Building{
int
captureProgress
;
// Fortschritt der Eroberung (0,1,2)
int
captureThreshold
;
BuildingFaction
bFaction
;
/*
Get the capturable parameter
To differentiate between
*/
virtual
bool
isCapturable
();
/*
Get the required unit type
Only Infantry should be able to cap
*/
virtual
bool
getUnitType
();
// to check if the unit is inf or any other viable type
/*
This returns the capture of the building
Might not be necessary if we issue the command that it takes exactly one turn for each building
But could be cool if the capital (win-con) takes 2 turns
*/
int
getCaptureProgress
()
const
{
return
captureProgress
;
}
virtual
void
capture
(
BuildingFaction
newFaction
,
int
capturePoints
);
//start capture: HP of unit is
/*
Start capturing:
Initialize the new Faction, and calculate caputurePoints
This should be started when an opposing team moves onto a building and thus starts capturing
*/
virtual
void
capture
(
BuildingFaction
newFaction
,
int
capturePoints
);
/*
Simply set the affected stats of the building back to base if the capturing unit is neutralized
*/
virtual
void
resetCapture
();
//reset health and stuff
// when clicked, start Interface stuff
/*
Checks if the building is clicked and calls the buildmenus
*/
virtual
void
on_Click
();
/*
Called only if the building can build something
Should show an overview of all Units that could be build and renders their price
*/
virtual
void
showBuildMenu
();
/*
Hides the build menu when no longer needed
*/
virtual
void
hideBuildMenu
();
//for recruiting
//check to see if enough monies and space available
/*
This checks if the player can recruit the chosen unit
*/
virtual
bool
canRecruitUnit
(
const
std
::
string
&
unitName
)
const
;
/*
Checks if the spawnposition is free from units
*/
virtual
bool
isSpawnPositionClear
()
const
;
/*
Checks if the player has enough resources to recruit the unit
*/
virtual
bool
hasEnoughResources
(
int
cost
)
const
;
/*
Must get the cost of the unit that has to be paid
could use a std::map with unitnames as keys and with prices as values
*/
virtual
int
getUnitCost
(
const
std
::
string
&
unitName
)
const
;
/*
Instantiates a new unit from the chosen type and spawns it on the map
Transfers ownership to the recruiting player
*/
virtual
bool
recruit_Unit
(
const
std
::
string
&
name
);
std
::
vector
<
std
::
string
>
recruitable_units
;
// buildable Units
std
::
map
<
std
::
string
,
int
>
unit_costs
;
...
...
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