Major code reorganization
This commit only updates the XCode project for the changes. A later commit each will update it for scons and MSVC. A few actual changes are mixed in: - Add a prefix header for a handful of common definitions - Moved current_cursor into the Cursor class as a static member - Removed the make_cursor_sword and make_cursor_watch functions - Include tests in the All target - Remove redundant -l flags for Common and Common-Party (since they're included in the Link phases anyway)
This commit is contained in:
53
src/race.hpp
Normal file
53
src/race.hpp
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// race.hpp
|
||||
// BoE
|
||||
//
|
||||
// Created by Celtic Minstrel on 17-04-13.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef BoE_RACE_HPP
|
||||
#define BoE_RACE_HPP
|
||||
|
||||
enum class eRace {
|
||||
UNKNOWN = -1, // for parameters to some functions; not valid in the class
|
||||
HUMAN = 0,
|
||||
NEPHIL = 1,
|
||||
SLITH = 2,
|
||||
VAHNATAI = 3, // Former value from eMonsterType
|
||||
REPTILE = 4, // 1
|
||||
BEAST = 5, // 2
|
||||
IMPORTANT = 6, // 3
|
||||
MAGE = 7, // 4
|
||||
PRIEST = 8, // 5
|
||||
HUMANOID = 9, // 6
|
||||
DEMON = 10, // 7
|
||||
UNDEAD = 11, // 8
|
||||
GIANT = 12, // 9
|
||||
SLIME = 13, // 10
|
||||
STONE = 14, // 11
|
||||
BUG = 15, // 12
|
||||
DRAGON = 16, // 13
|
||||
MAGICAL = 17, // 14
|
||||
PLANT = 18,
|
||||
BIRD = 19,
|
||||
SKELETAL = 20,
|
||||
GOBLIN = 21,
|
||||
};
|
||||
|
||||
// Types IMPORTANT, MAGE, and PRIEST are implicitly human
|
||||
inline bool isHuman(eRace race) {
|
||||
int code = (int) race;
|
||||
return code == 0 || (code >= 6 && code <= 8);
|
||||
}
|
||||
|
||||
// Types NEPHIL, SLITH, and VAHNATAI are implicitly humanoid
|
||||
inline bool isHumanoid(eRace race) {
|
||||
int code = (int) race;
|
||||
return (code >= 0 && code <= 3) || (code >= 6 && code <= 9) || code == 21;
|
||||
}
|
||||
|
||||
std::ostream& operator << (std::ostream& out, eRace e);
|
||||
std::istream& operator >> (std::istream& in, eRace& e);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user