[Server] Make a few function names more consistent and fix typos

new-script-api
David Cernat 7 years ago
parent 7788821a69
commit ba161ddddd

@ -14,7 +14,7 @@ using namespace std;
void Cells::Init(LuaState &lua) void Cells::Init(LuaState &lua)
{ {
lua.getState()->new_usertype<Cells>("Cell", lua.getState()->new_usertype<Cells>("Cell",
"description", sol::property(&Cells::getCell, &Cells::setCell), "description", sol::property(&Cells::getDescription, &Cells::setDescription),
"getExterior", &Cells::getExterior, "getExterior", &Cells::getExterior,
"setExterior", &Cells::setExterior, "setExterior", &Cells::setExterior,
"getRegion", &Cells::getRegion, "getRegion", &Cells::getRegion,
@ -39,12 +39,12 @@ void Cells::update()
} }
std::string Cells::getCell() const std::string Cells::getDescription() const
{ {
return netActor->getNetCreature()->cell.getDescription(); return netActor->getNetCreature()->cell.getDescription();
} }
void Cells::setCell(const std::string &cellDescription) void Cells::setDescription(const std::string &cellDescription)
{ {
/*LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Script is moving %s from %s to %s", netActor->getNetCreature()->npc.mName.c_str(), /*LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Script is moving %s from %s to %s", netActor->getNetCreature()->npc.mName.c_str(),
netActor->getNetCreature()->cell.getDescription().c_str(), cellDescription.c_str());*/ netActor->getNetCreature()->cell.getDescription().c_str(), cellDescription.c_str());*/

@ -21,8 +21,8 @@ public:
void update(); void update();
std::string getCell() const; std::string getDescription() const;
void setCell(const std::string &cellDescription); void setDescription(const std::string &cellDescription);
std::tuple<int, int> getExterior() const; std::tuple<int, int> getExterior() const;
void setExterior(int x, int y); void setExterior(int x, int y);

@ -19,7 +19,7 @@ void CharClass::Init(LuaState &lua)
"isDefault", &CharClass::isDefault, "isDefault", &CharClass::isDefault,
"name", sol::property(&CharClass::getName, &CharClass::setName), "name", sol::property(&CharClass::getName, &CharClass::setName),
"description", sol::property(&CharClass::getDesc, &CharClass::setDesc), "description", sol::property(&CharClass::getDescription, &CharClass::setDescription),
"specialization", "specialization",
sol::property(&CharClass::getSpecialization, &CharClass::setSpecialization), sol::property(&CharClass::getSpecialization, &CharClass::setSpecialization),
@ -72,12 +72,12 @@ string CharClass::getName() const
return player->charClass.mName; return player->charClass.mName;
} }
std::string CharClass::getDesc() const std::string CharClass::getDescription() const
{ {
return player->charClass.mDescription; return player->charClass.mDescription;
} }
void CharClass::setDesc(const string &desc) void CharClass::setDescription(const string &desc)
{ {
player->charClass.mDescription = desc; player->charClass.mDescription = desc;
changed = true; changed = true;
@ -115,10 +115,10 @@ std::tuple<int, int, int, int, int> CharClass::getMinorSkills() const
return make_tuple( data.mSkills[0][0], data.mSkills[1][0], data.mSkills[2][0], data.mSkills[3][0], data.mSkills[4][0]); return make_tuple( data.mSkills[0][0], data.mSkills[1][0], data.mSkills[2][0], data.mSkills[3][0], data.mSkills[4][0]);
} }
void CharClass::setMinorSkills(int fisrt, int second, int third, int fourth, int fifth) void CharClass::setMinorSkills(int first, int second, int third, int fourth, int fifth)
{ {
auto &data = player->charClass.mData; auto &data = player->charClass.mData;
data.mSkills[0][0] = fisrt; data.mSkills[0][0] = first;
data.mSkills[1][0] = second; data.mSkills[1][0] = second;
data.mSkills[2][0] = third; data.mSkills[2][0] = third;
data.mSkills[3][0] = fourth; data.mSkills[3][0] = fourth;
@ -132,10 +132,10 @@ std::tuple<int, int, int, int, int> CharClass::getMajorSkills() const
return make_tuple( data.mSkills[0][1], data.mSkills[1][1], data.mSkills[2][1], data.mSkills[3][1], data.mSkills[4][1]); return make_tuple( data.mSkills[0][1], data.mSkills[1][1], data.mSkills[2][1], data.mSkills[3][1], data.mSkills[4][1]);
} }
void CharClass::setMajorSkills(int fisrt, int second, int third, int fourth, int fifth) void CharClass::setMajorSkills(int first, int second, int third, int fourth, int fifth)
{ {
auto &data = player->charClass.mData; auto &data = player->charClass.mData;
data.mSkills[0][1] = fisrt; data.mSkills[0][1] = first;
data.mSkills[1][1] = second; data.mSkills[1][1] = second;
data.mSkills[2][1] = third; data.mSkills[2][1] = third;
data.mSkills[3][1] = fourth; data.mSkills[3][1] = fourth;

@ -27,8 +27,8 @@ public:
std::string getName() const; std::string getName() const;
void setName(const std::string &className); void setName(const std::string &className);
std::string getDesc() const; std::string getDescription() const;
void setDesc(const std::string &desc); void setDescription(const std::string &desc);
std::tuple<int, int> getMajorAttributes() const; std::tuple<int, int> getMajorAttributes() const;
void setMajorAttributes(int first, int second); void setMajorAttributes(int first, int second);

Loading…
Cancel
Save