Прототип кода, сгенерированный в Enterprise Architect
Void AutoAttack (); PlayerCharacter (); Include «NPC.h». Include «Bag.h». Void NextLevel (); PlayerCharacter.h. Int LevelRequired; Bool checkDead (); Void Redefine (); Void Redefine (); Void Interact (); Void DropItem (); Virtual ~Item (); Virtual ~Buff (); Item DroppedItem; Float multHealth; Float multAttack; Bool checkExp (); Void Respond (); Virtual ~NPC (); Virtual ~Bag (); Int BonusHealth… Читать ещё >
Прототип кода, сгенерированный в Enterprise Architect (реферат, курсовая, диплом, контрольная)
Addition.h.
class Addition.
{.
public:
Addition ();
virtual ~Addition ();
protected:
int BonusArmor;
int BonusAS;
int BonusAttack;
int BonusHealth;
int BonusMana;
float BonusMReg;
int BonusMRes;
int BonusMS;
int BonusSP;
};
Buff.h.
#include «Addition.h» .
class Buff: public Addition.
{.
public:
Buff ();
virtual ~Buff ();
void lowerDuration ();
protected:
char BuffName[30];
float Duration;
float EndsIn;
float multArmor;
float multAS;
float multAttack;
float multHealth;
float multMana;
float multMReg;
float multMRes;
float multMS;
float multSP;
};
BuffList.h.
#include «Buff.h» .
class BuffList.
{.
public:
BuffList ();
virtual ~BuffList ();
Buff *m_Buff;
void addBuff (Buff aBuff);
void lowerDuration ();
void removeBuff (int BuffNum);
};
Character.h.
class Character.
{.
public:
Character ();
virtual ~Character ();
bool Ability1();
bool Ability2();
bool Ability3();
bool Ability4();
bool Ability5();
bool Ability6();
void AutoAttack ();
bool checkDead ();
int DealDamage (int SpScale, int AttackScale);
void Jump ();
void lowerCooldown ();
void Move (int dir);
void TakeDamage (int DmgCaused, int DmgType);
protected:
int Armor;
int Attack;
int AttackSpeed;
BuffList Buffs;
int CharLevel;
int Class;
float Cooldown[6];
int Health;
bool inCombat;
bool isDead;
int MagicResistance;
int Mana;
float ManaReg;
int maxHealth;
int maxMana;
int MoveSpeed;
char name[30];
bool onSurface;
int Race;
int SpellPower;
};
Item.h.
#include «Addition.h» .
class Item: public Addition.
{.
public:
Item ();
virtual ~Item ();
bool checkLevel (int Level);
protected:
char ItemName[30];
int LevelRequired;
int Slot;
};
Inventory.h.
#include «Addition.h» .
#include «Item.h» .
class Inventory: public Addition.
{.
public:
Inventory ();
virtual ~Inventory ();
Item *m_Item;
bool checkLevel (int Level, Item eItem);
void EquipItem (Item eItem);
Item removeItem (int Slot);
};
Bag.h.
#include «Item.h» .
class Bag.
{.
public:
Bag ();
virtual ~Bag ();
Item *m_Item;
void addItem (Item cItem);
Item takeFrom (int SlotNum);
protected:
int SlotsLeft;
};
NPC.h.
#include «Item.h» .
#include «PlayerCharacter.h» .
#include «Character.h» .
class NPC: public Character.
{.
public:
NPC ();
virtual ~NPC ();
PlayerCharacter *m_PlayerCharacter;
void DropItem ();
void Interact ();
void newTarget (PlayerCharacter tPC);
void Redefine ();
void Respond ();
protected:
Item DroppedItem;
int ExpGranted;
bool isEnemy;
PlayerCharacter* Target;
};
PlayerCharacter.h.
#include «Bag.h» .
#include «Inventory.h» .
#include «Item.h» .
#include «NPC.h» .
#include «Character.h» .
class PlayerCharacter: public Character.
{.
public:
PlayerCharacter ();
virtual ~PlayerCharacter ();
void addExp (int exp);
bool checkExp ();
Item LootItem (NPC DeadNPC);
void newTarget (NPC tNPC);
void NextLevel ();
void Redefine ();
void tryInteract ();
protected:
Bag Bag;
int CharExp;
Inventory Inventory;
NPC* Target;
};