-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ➕ added Initial classes code * ➕ Added more parameters * 📝 created army classes * ➕ added unit classes * 🐛 fixed spacing * 🐛 fixed namings * 🔨 Fixed Visual Studio filter files * ✏️ Fixed typos * 🎨 Improved code consistency * ✨ Added Unit.cpp * 📝 Added func declaration for abstract functions * ✨ Fixed ifndef causing build errors * ➕ fixed lists of armies * 🎨 improved Container functions efficiency/consistency by making them all inline functions --------- Co-authored-by: Habiba Ayman <HabibaAyman2004@outlook.com> Co-authored-by: AhmedSobhy01 <samahmedsobhy@gmail.com>
- Loading branch information
1 parent
3e79619
commit c9c7b6e
Showing
23 changed files
with
199 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef ALIEN_ARMY_H | ||
#define ALIEN_ARMY_H | ||
|
||
#include "Army.h" | ||
#include "..\Containers\LinkedQueue.h" | ||
#include "..\Containers\ArrayStack.h" | ||
#include "..\Containers\Deque.h" | ||
#include "..\UnitClasses\Unit.h" | ||
#include "..\UnitClasses\AlienSoldier.h" | ||
#include "..\UnitClasses\AlienMonster.h" | ||
#include "..\UnitClasses\AlienDrone.h" | ||
|
||
class AlienArmy: public Army | ||
{ | ||
LinkedQueue<AlienSoldier*> soliders; | ||
// Array <AlienMonster> monsters; | ||
Deque<AlienDrone*> drones; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef ARMY_H | ||
#define ARMY_H | ||
|
||
class Army | ||
{ | ||
public: | ||
virtual void addUnit() = 0; // Will take a pointer to Unit as a parameter | ||
virtual void removeUnit() = 0; | ||
virtual void print() const = 0; | ||
virtual void attack() = 0; | ||
}; | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef EARTH_ARMY_H | ||
#define EARTH_ARMY_H | ||
|
||
#include "Army.h" | ||
#include "..\UnitClasses\Unit.h" | ||
#include "..\Containers\ArrayStack.h" | ||
#include "..\Containers\LinkedQueue.h" | ||
#include "..\Containers\PriorityQueue.h" | ||
#include "..\UnitClasses\Unit.h" | ||
#include "..\UnitClasses\EarthSoldier.h" | ||
#include "..\UnitClasses\EarthTank.h" | ||
#include "..\UnitClasses\EarthGunnery.h" | ||
|
||
class EarthArmy: public Army | ||
{ | ||
LinkedQueue<EarthSoldier*> soldiers; | ||
ArrayStack<EarthTank*> tanks; | ||
PriorityQueue<EarthGunnery*> gunneries; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.