Move stream operator declarations into the same file as their types

This commit is contained in:
2017-04-14 01:07:21 -04:00
parent e98f9381fe
commit 4baac518e9
10 changed files with 32 additions and 29 deletions

View File

@@ -116,7 +116,14 @@ inline bool isDead(eMainStatus stat) {
std::ostream& operator << (std::ostream& out, eStatus e); std::ostream& operator << (std::ostream& out, eStatus e);
std::istream& operator >> (std::istream& in, eStatus& e); std::istream& operator >> (std::istream& in, eStatus& e);
std::istream& operator >> (std::istream& in, ePartyStatus& type);
std::ostream& operator << (std::ostream& out, ePartyStatus type);
std::ostream& operator << (std::ostream& out, eMainStatus e);
std::istream& operator >> (std::istream& in, eMainStatus& e);
std::ostream& operator << (std::ostream& out, eDamageType e); std::ostream& operator << (std::ostream& out, eDamageType e);
std::istream& operator >> (std::istream& in, eDamageType& e); std::istream& operator >> (std::istream& in, eDamageType& e);
void operator += (eMainStatus& stat, eMainStatus othr);
void operator -= (eMainStatus& stat, eMainStatus othr);
#endif #endif

View File

@@ -61,15 +61,6 @@ public:
void readFrom(std::istream& sin); void readFrom(std::istream& sin);
}; };
std::ostream& operator << (std::ostream& out, eItemType e);
std::ostream& operator << (std::ostream& out, eItemAbil e);
std::istream& operator >> (std::istream& in, eItemType& e);
std::istream& operator >> (std::istream& in, eItemAbil& e);
std::ostream& operator << (std::ostream& out, eSkill e);
std::istream& operator >> (std::istream& in, eSkill& e);
std::ostream& operator << (std::ostream& out, eItemUse e);
std::istream& operator >> (std::istream& in, eItemUse& e);
class cSpecItem { class cSpecItem {
public: public:
short flags = 0; short flags = 0;

View File

@@ -111,4 +111,7 @@ inline eItemAbilCat getItemAbilCategory(eItemAbil abil) {
return eItemAbilCat::INVALID; return eItemAbilCat::INVALID;
} }
std::ostream& operator << (std::ostream& out, eItemAbil e);
std::istream& operator >> (std::istream& in, eItemAbil& e);
#endif #endif

View File

@@ -62,4 +62,9 @@ enum class eItemUse {HELP_ONE, HARM_ONE, HELP_ALL, HARM_ALL};
enum class eEnchant {PLUS_ONE, PLUS_TWO, PLUS_THREE, SHOOT_FLAME, FLAMING, PLUS_FIVE, BLESSED}; enum class eEnchant {PLUS_ONE, PLUS_TWO, PLUS_THREE, SHOOT_FLAME, FLAMING, PLUS_FIVE, BLESSED};
std::ostream& operator << (std::ostream& out, eItemUse e);
std::istream& operator >> (std::istream& in, eItemUse& e);
std::ostream& operator << (std::ostream& out, eItemType e);
std::istream& operator >> (std::istream& in, eItemType& e);
#endif #endif

View File

@@ -22,4 +22,7 @@ public:
std::string descr; std::string descr;
}; };
std::istream& operator>>(std::istream& in, eQuestStatus& type);
std::ostream& operator<<(std::ostream& out, eQuestStatus type);
#endif #endif

View File

@@ -49,13 +49,4 @@ public:
void writeTo(std::ostream& file) const; void writeTo(std::ostream& file) const;
}; };
std::ostream& operator << (std::ostream& out, eTerSpec e);
std::istream& operator >> (std::istream& in, eTerSpec& e);
std::ostream& operator << (std::ostream& out, eTrimType e);
std::istream& operator >> (std::istream& in, eTrimType& e);
std::ostream& operator << (std::ostream& out, eTerObstruct e);
std::istream& operator >> (std::istream& in, eTerObstruct& e);
std::ostream& operator << (std::ostream& out, eStepSnd e);
std::istream& operator >> (std::istream& in, eStepSnd& e);
#endif #endif

View File

@@ -86,4 +86,13 @@ inline bool blocksMove(eTerObstruct block) {
enum class eStepSnd {STEP, SQUISH, CRUNCH, NONE, SPLASH}; enum class eStepSnd {STEP, SQUISH, CRUNCH, NONE, SPLASH};
std::ostream& operator << (std::ostream& out, eTerSpec e);
std::istream& operator >> (std::istream& in, eTerSpec& e);
std::ostream& operator << (std::ostream& out, eTrimType e);
std::istream& operator >> (std::istream& in, eTrimType& e);
std::ostream& operator << (std::ostream& out, eTerObstruct e);
std::istream& operator >> (std::istream& in, eTerObstruct& e);
std::ostream& operator << (std::ostream& out, eStepSnd e);
std::istream& operator >> (std::istream& in, eStepSnd& e);
#endif #endif

View File

@@ -60,4 +60,9 @@ enum class eTrait {
ANAMA = 16, ANAMA = 16,
}; };
std::ostream& operator << (std::ostream& out, eSkill e);
std::istream& operator >> (std::istream& in, eSkill& e);
std::ostream& operator << (std::ostream& out, eTrait e);
std::istream& operator >> (std::istream& in, eTrait& e);
#endif #endif

View File

@@ -236,9 +236,5 @@ bool operator==(const cParty::cEncNote& one, const cParty::cEncNote& two);
std::istream& operator>>(std::istream& in, eEncNoteType& type); std::istream& operator>>(std::istream& in, eEncNoteType& type);
std::ostream& operator<<(std::ostream& out, eEncNoteType type); std::ostream& operator<<(std::ostream& out, eEncNoteType type);
std::istream& operator>>(std::istream& in, ePartyStatus& type);
std::ostream& operator<<(std::ostream& out, ePartyStatus type);
std::istream& operator>>(std::istream& in, eQuestStatus& type);
std::ostream& operator<<(std::ostream& out, eQuestStatus type);
#endif #endif

View File

@@ -176,11 +176,4 @@ public:
cPlayer& operator=(cPlayer other) = delete; cPlayer& operator=(cPlayer other) = delete;
}; };
void operator += (eMainStatus& stat, eMainStatus othr);
void operator -= (eMainStatus& stat, eMainStatus othr);
std::ostream& operator << (std::ostream& out, eMainStatus e);
std::istream& operator >> (std::istream& in, eMainStatus& e);
std::ostream& operator << (std::ostream& out, eTrait e);
std::istream& operator >> (std::istream& in, eTrait& e);
#endif #endif