generated from sigonasr2/CPlusPlusProjectTemplate
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
#include "entity.h"
|
|
#include "object.h"
|
|
|
|
extern std::array<std::string,7> PARTY_MEMBER_NAMES;
|
|
|
|
std::ostream&operator<<(std::ostream &os,Entity&ent){
|
|
os<<
|
|
ent.GetHP()<<" "<<
|
|
ent.stats.maxHP<<" "<<
|
|
PARTY_MEMBER_NAMES[ent.partyMemberID]<<" "<<
|
|
ent.GetPP()<<" "<<
|
|
ent.stats.maxPP<<" "<<
|
|
ent.stats.baseAtk<<" "<<
|
|
ent.stats.speed<<" "<<
|
|
ent.stats.resistances.size()<<" ";
|
|
for (int i=0;i<ent.stats.resistances.size();i++) {
|
|
os<<ent.stats.resistances[i]<<" ";
|
|
}
|
|
os<<ent.stats.damageReduction<<" "<<
|
|
ent.stats.smart<<" "<<
|
|
ent.stats.dumb<<" "<<
|
|
ent.moveSet.size()<<" ";
|
|
for (int i=0;i<ent.moveSet.size();i++) {
|
|
os<<(int)ent.moveSet[i]->id<<" ";
|
|
}
|
|
os<<ent.statusEffects.size()<<" ";
|
|
for (std::map<Property,int>::iterator it=ent.statusEffects.begin();it!=ent.statusEffects.end();++it) {
|
|
os<<(int)it->first<<" "<<it->second<<" ";
|
|
}
|
|
os<<ent.equipment.size()<<" ";
|
|
for (int i=0;i<3;i++) {
|
|
if (ent.equipment[i]!=nullptr) {
|
|
os<<(int)ent.equipment[i]->id<<" ";
|
|
} else {
|
|
os<<-1<<" ";
|
|
}
|
|
}
|
|
if (ent.obj!=nullptr) {
|
|
os<<ent.obj->GetPos().x<<" "<<ent.obj->GetPos().y<<" ";
|
|
} else {
|
|
os<<-999<<" "<<-999<<" ";
|
|
}
|
|
return os;
|
|
} |