1 #ifndef CORE_PEOPLEMON_TYPE_HPP
2 #define CORE_PEOPLEMON_TYPE_HPP
18 enum struct Type : std::uint8_t {
37 return static_cast<Type>(
static_cast<std::uint8_t
>(l) &
static_cast<std::uint8_t
>(r));
48 return static_cast<Type>(
static_cast<std::uint8_t
>(l) |
static_cast<std::uint8_t
>(r));
91 static inline bool isType(
Type type,
Type check) {
return (type & check) == check; }
Type
Represents a type that a move or Peoplemon can be. Types may be combined.
Core classes and functionality for both the editor and game.
Type operator&(Type l, Type r)
Binary AND for Type values.
Type operator|(Type l, Type r)
Binary OR for Type values.
Contains a collection of helper methods for types.
static std::pair< Type, Type > getTypes(Type type)
Returns the primary and secondary type of the given composite type.
static std::string getTypeString(Type type)
Returns the type as a user-facing text string.
static float getStab(Type moveType, Type userType)
Returns the STAB multiplier for a move.
static float getSuperMult(Type moveType, Type defenderType)
Returns the multiplier for if/when a move is super effective.
static bool isType(Type type, Type check)
Checks whether the given type contains the type to check.
static Type legacyTypeToNew(unsigned int ogType)
Helper method to convert old type ids to the new.