-
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
- Loading branch information
1 parent
1a63902
commit 3e79619
Showing
9 changed files
with
129 additions
and
3 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,9 @@ | ||
#ifndef ALIENDRONE_H | ||
#define ALIENDRONE_H | ||
|
||
#include "Unit.h" | ||
class AlienDrone: public Unit | ||
{ | ||
|
||
}; | ||
#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,9 @@ | ||
#ifndef ALIENMONSTER_H | ||
#define ALIENMONSTER_H | ||
|
||
#include "Unit.h" | ||
class AlienMonster: public Unit | ||
{ | ||
|
||
}; | ||
#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,9 @@ | ||
#ifndef ALIENSOLIDER_H | ||
#define ALIENSOLIDER_H | ||
|
||
#include "Unit.h" | ||
class AlienSolider: public Unit | ||
{ | ||
|
||
}; | ||
#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,10 @@ | ||
#ifndef EARTHGUNNERY_H | ||
#define EARTHGUNNERY_H | ||
|
||
#include "Unit.h" | ||
class EearthGunnery: public Unit | ||
{ | ||
|
||
}; | ||
#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,10 @@ | ||
#ifndef EARTHSOLIDER_H | ||
#define EARTHSOLIDER_H | ||
|
||
#include "Unit.h" | ||
class EearthSolider: public Unit | ||
{ | ||
|
||
}; | ||
#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,10 @@ | ||
#ifndef EARTHTANK_H | ||
#define EARTHTANK_H | ||
|
||
#include "Unit.h" | ||
class EearthTank: public Unit | ||
{ | ||
|
||
}; | ||
#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,36 @@ | ||
#ifndef UNIT_H | ||
#define UNIT_H | ||
|
||
enum UnitType | ||
{ | ||
ES, EG, ET, | ||
AS, AD, AM | ||
}; | ||
class Unit | ||
{ | ||
UnitType unitType; | ||
int id; | ||
|
||
int Tj; // Join time | ||
int Ta; // First attack time | ||
int Td; // Destruction time | ||
|
||
int Df; // First attack delay | ||
int Dd; // Destruction delay | ||
int Db; // Battle time | ||
|
||
int health; | ||
int power; | ||
int attackCapacity; | ||
public: | ||
void recieveDamage(int loss); | ||
virtual void print() = 0; | ||
virtual void attack(Unit* aUnit) = 0; //shouldn't it be passed a list??? will check later | ||
|
||
}; | ||
#endif | ||
|
||
void Unit:: recieveDamage(int loss) | ||
{ | ||
health -= loss; | ||
} |