Question: I ' m doing a C + + programming assignment where there is a part of the call function that looks like this: A two
Im doing a C programming assignment where there is a part of the call function that looks like this:
A twodimensional matrix as a map, each cell may be an uppercase letter for a fighter eg A and B or a space for an open space, and I need to write a call function to complete the fight action.
Fight means that if A and B are adjacent to each other in the matrix, and A fights B Bs HP will be reduced, and the reduction value is As FP If A and B are not adjacent, the Battle Order is invalid.
Excuse me how do I do this call function?
The content of include is iostream and cstring, please do not add new include content
TODO: Implement updateMapAndHealthPointsForFightAction
This function handles the updates based on the fight action
@param healthPoints: The D array storing the health points of warriors
@param map: The D array storing the map information
@param mapRows: The number of rows for this map
@param mapCols: The number of columns for this map
@param fightPoints: The D array storing the fight points of warriors
@param letter: The warrior letter that triggers the fight action
@param direction: The direction enum, please check DirectionType enum
We have parameters that are passbyreference. They will be returned to the main function:
@param targetLetter: The target warrior letter
@param targetOriginalHealthPoint: The original health point of the target warrior
@param targetUpdatedHealthPoint: The updated health point of the target warrior
@return The status of the fight action, please check StatusFightAction enum
StatusFightAction updateMapAndHealthPointsForFightActionint healthPointsMAXNUMWARRIORS
char mapMAXROWSMAXCOLS
int mapRows, int mapCols,
const int fightPointsMAXNUMWARRIORS
char letter,
DirectionType direction,
char &targetLetter,
int &targetOriginalHealthPoint,
int &targetUpdatedHealthPoint
return STATUSACTIONFIGHTNOTIMPLEMENTED;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
