00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef __cplusplus
00024
00025 # ifndef OGS_CORE_EXPERIENCE_H
00026 # define OGS_CORE_EXPERIENCE_H
00027
00028 # include <string>
00029
00030 # include <ogs/core/Modifier.h>
00031 # include <ogs/core/Namespace.h>
00032
00033 OGS_BEGIN_CORE_NAMESPACE
00034
00035 class Experience;
00036
00038 typedef Experience XP;
00039
00046 class Experience {
00047 public:
00049 typedef unsigned int Points;
00051 typedef unsigned short Level;
00052
00053 static Level getLevel (Points points);
00054 static Points getPoints (Level level);
00055
00056 static Modifier::Value getStrongAttack (Level level);
00057 static Modifier::Value getAverageAttack (Level level);
00058 static Modifier::Value getWeakAttack (Level level);
00059
00060 static std::string formatLevel (Level level);
00061 };
00062
00069 inline Modifier::Value
00070 Experience::getStrongAttack (Level level) {
00071 return (level);
00072 }
00073
00080 inline Modifier::Value
00081 Experience::getAverageAttack (Level level) {
00082 return ((3 * level) / 4);
00083 }
00084
00090 inline Modifier::Value
00091 Experience::getWeakAttack (Level level) {
00092 return (level / 2);
00093 }
00094
00095 OGS_END_CORE_NAMESPACE
00096
00097 # endif
00098
00099 #endif
00100