void MathStudent::SetAllMath(string newName, string newStanding, string newNumber, long newId, unsigned short newAge, double newGpa, char newGender, int newMonth, int newDay, int newYear, char * newAddress, char * newCity, char * newState, long newZipCode) { SetName(newName); SetStanding(newStanding); SetNumber(newNumber); SetId(newId); SetAge(newAge); SetGpa(newGpa); SetGender(newGender); SetAllDate(newMonth, newDay, newYear); SetAddress(newAddress); SetCity(newCity); SetState(newState); SetZipCode(newZipCode); }
Character::Character(std::string fromString) { std::vector<std::string> tokens = utils::Tokenfy(fromString, '|'); if (tokens[0] == "PLAYER_OBJECT") { SetName(tokens[57]); SetLastname(tokens[58]); SetRace(tokens[59]); SetGender(tokens[60]); SetFace(tokens[61]); SetSkin(tokens[62]); SetZone(tokens[63]); SetLevel(std::stoi(tokens[64])); SetHp(std::stoi(tokens[65])); SetMaxHp(std::stoi(tokens[66])); SetBp(std::stoi(tokens[67])); SetMaxBp(std::stoi(tokens[68])); SetMp(std::stoi(tokens[69])); SetMaxMp(std::stoi(tokens[70])); SetEp(std::stoi(tokens[71])); SetMaxEp(std::stoi(tokens[72])); SetStrength(std::stoi(tokens[73])); SetConstitution(std::stoi(tokens[74])); SetIntelligence(std::stoi(tokens[75])); SetDexterity(std::stoi(tokens[76])); SetX(std::stof(tokens[77])); SetY(std::stof(tokens[78])); SetZ(std::stof(tokens[79])); SetPitch(std::stof(tokens[80])); SetYaw(std::stof(tokens[81])); } // if (tokens[0] == "NPC_OBJECT") { // // } }
void MathStudent::CopyFrom(MathStudent otherStudent) { delete [] address; delete [] city; delete [] state; address = new char[strlen(otherStudent.GetAddress())+1]; strcpy(address, otherStudent.GetAddress()); city = new char[strlen(otherStudent.GetCity())+1]; strcpy(city, otherStudent.GetCity()); state = new char[strlen(otherStudent.GetState())+1]; strcpy(state, otherStudent.GetState()); zipCode = otherStudent.GetZipCode(); SetName(otherStudent.GetName()); SetStanding(otherStudent.GetStanding()); SetNumber(otherStudent.GetNumber()); SetId(otherStudent.GetId()); SetAge(otherStudent.GetAge()); SetGpa(otherStudent.GetGpa()); SetGender(otherStudent.GetGender()); SetAllDate(otherStudent.GetMonth(), otherStudent.GetDay(), otherStudent.GetYear()); }
/** Constructor * \param aquarium The aquarium we are in * \param filename Filename for the image we use */ CFish::CFish(CAquarium *aquarium, const std::wstring &filename) : CItem(aquarium, filename) { mSpeedX = ((double)rand() / RAND_MAX) * MaxSpeedX; if (((double)rand() / RAND_MAX) > 0.5){ mSpeedY = ((double)rand() / RAND_MAX) * MaxSpeedY; SetGender(MALE); } else{ mSpeedY = -1*((double)rand() / RAND_MAX) * MaxSpeedY; SetGender(FEMALE); } mDaysSinceFed = 0; }
static void DBExtraIconsInit() { hExtraChat = ExtraIcon_Register("chat_activity", "Chat activity", "ChatActivity"); hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", "AlwaysVis"); hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male"); for (unsigned int i = 0; i < MAX_REGS(infos); ++i) { Info &info = infos[i]; if (info.OnClick) info.hExtraIcon = ExtraIcon_Register(info.name, info.desc, info.icon, DefaultOnClick, (LPARAM) &info); else info.hExtraIcon = ExtraIcon_Register(info.name, info.desc, info.icon); } HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); while (hContact != NULL) { SetExtraIcons(hContact); SetVisibility(hContact, -1, FALSE); SetGender(hContact, -1, FALSE); hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); } hHooks.push_back(HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged)); }
void DefaultExtraIcons_Load() { hExtraChat = ExtraIcon_Register("chat_activity", LPGEN("Chat activity"), "ChatActivity"); hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", LoadSkinnedIconName(SKINICON_OTHER_VISIBLE_ALL)); hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male"); hExtraProto = ExtraIcon_Register("protocol", "Account", LoadSkinnedIconName(SKINICON_OTHER_ACCMGR), &ProtocolRebuildIcons, &ProtocolApplyIcon, &ProtocolOnClick); for (int i = 0; i < SIZEOF(infos); i++) { Info &p = infos[i]; p.hIcolib = LoadSkinnedIconHandle(p.iSkinIcon); if (p.OnClick) p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon), DefaultOnClick, (LPARAM)&p); else p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon)); } for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { SetExtraIcons(hContact); SetVisibility(hContact, -1, false); SetGender(hContact, -1, false); } HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged); }
MathStudent::MathStudent(const MathStudent& otherStudent) { address = new char[strlen(otherStudent.GetAddress())+1]; strcpy(address, otherStudent.GetAddress()); city = new char[strlen(otherStudent.GetCity())+1]; strcpy(city, otherStudent.GetCity()); state = new char[strlen(otherStudent.GetState())+1]; strcpy(state, otherStudent.GetState()); zipCode = otherStudent.GetZipCode(); SetName(otherStudent.GetName()); SetStanding(otherStudent.GetStanding()); SetNumber(otherStudent.GetNumber()); SetId(otherStudent.GetId()); SetAge(otherStudent.GetAge()); SetGpa(otherStudent.GetGpa()); SetGender(otherStudent.GetGender()); SetAllDate(otherStudent.GetMonth(), otherStudent.GetDay(),otherStudent.GetYear()); SetObjectCount(otherStudent.GetObjectCount()); cout << "\nCopy constructor has been called."; }
MathStudent::MathStudent() { SetObjectCount(count); address = new char[5]; strcpy(address, "add"); city = new char[5]; strcpy(city, "cit"); state = new char[5]; strcpy(state, "sta"); zipCode = 0; SetName(" "); SetStanding(" "); SetNumber(" "); SetId(0); SetAge(0); SetGpa(0.0); SetGender('X'); SetAllDate(0,0,0); }
/*************************************************************************** * PromptUserForInput * ------------------------------------------------------------------------- * This method will prompt the user for each input * * Returns: ***************************************************************************/ void Student::PropagateStudent() { const int WIDTH = 21; string newName; long newId; string newNumber; unsigned short newAge; char newGender; string newStanding; double newGpa; int month, day, year; cout << "\nEnter the proper information to continue.\n"; cout << setw(WIDTH) << "Enter Name: " ; getline(cin, newName); SetName(newName); cout << setw(WIDTH) << "Enter ID: "; cin >> newId; SetId(newId); cin.ignore(numeric_limits<streamsize>::max(), '\n'); cout << setw(WIDTH) << "Enter phone number: "; getline(cin, newNumber); SetNumber(newNumber); cout << setw(WIDTH) << "Enter age: "; cin >> newAge; cin.ignore(numeric_limits<streamsize>::max(), '\n'); SetAge(newAge); cout << setw(WIDTH) << "Enter Gender: "; cin.get(newGender); cin.ignore(numeric_limits<streamsize>::max(), '\n'); SetGender(newGender); cout << setw(WIDTH) << "Enter Class Standing: "; getline(cin, newStanding); SetStanding(newStanding); cout << setw(WIDTH) << "Enter GPA: "; cin >> newGpa; cin.ignore(numeric_limits<streamsize>::max(), '\n'); SetGpa(newGpa); cout << "Enter year of month, day, and year of graduation: "; cin >> month >> day >> year; SetAllDate(month, day, year); cin.ignore(numeric_limits<streamsize>::max(), '\n'); }
Student::Student(char * name, char * second_name, char * surname, GENDER gender, Date birth, char * ofStudent, int * Exams, int * Courses, int * Moduls) { SetName(name); SetSecond(second_name); SetSurname(surname); SetGender(gender); this->birth = birth; SetAdress(ofStudent); SetExams(Exams); SetCourses(Courses); SetModuls(Moduls); }
void Student::operator=(const Student& other) { SetName(other.name); SetSecond(other.second_name); SetSurname(other.surname); SetGender(other.gender); this->birth = other.birth; SetAdress(other.ofStudent); SetExams(other.Exams); SetCourses(other.Courses); SetModuls(other.Moduls); }
static int SettingChanged(WPARAM wParam, LPARAM lParam) { HANDLE hContact = (HANDLE) wParam; DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*) lParam; if (hContact == NULL) return 0; char *proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0); if (IsEmpty(proto)) return 0; bool isProto = (strcmp(cws->szModule, proto) == 0); if (isProto && strcmp(cws->szSetting, "ApparentMode") == 0) { SetVisibility(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.wVal, TRUE); return 0; } if (strcmp(cws->szSetting, "Gender") == 0 && (isProto || strcmp(cws->szModule, "UserInfo") == 0)) { SetGender(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal, TRUE); return 0; } for (unsigned int i = 0; i < MAX_REGS(infos); ++i) { Info &info = infos[i]; for (unsigned int j = 0; j < MAX_REGS(info.db); j += 2) { if (info.db[j + 1] == NULL) break; if (info.db[j] == NULL && !isProto) continue; if (info.db[j] != NULL && strcmp(cws->szModule, info.db[j])) continue; if (strcmp(cws->szSetting, info.db[j + 1])) continue; bool show = (cws->value.type != DBVT_DELETED && !IsEmpty(cws->value.pszVal)); info.SetIcon(hContact, &info, show ? cws->value.pszVal : NULL); break; } } return 0; }
void create(){ ::create(); SetKeyName("clerk"); SetId("clerk"); SetAdjectives("town"); SetGender("male"); SetRace("human"); SetShort("the town clerk"); SetLong("An officious-looking clerk."); SetLocalCurrency("silver"); SetClass("priest"); AddCommandResponse("marry", (: MarriageRequest :)); AddCommandResponse("wed", (: MarriageRequest :)); AddCommandResponse("join", (: MarriageRequest :)); AddCommandResponse("divorce", (: eventRequestDivorce :)); SetLevel(4); SetTax(5); }
Character::Character(std::string name, std::string lastname, std::string race, std::string gender, std::string face, std::string skin, std::string zone, int level, int hp, int maxHp, int bp, int maxBp, int mp, int maxMp, int ep, int maxEp, int strength, int constitution, int intelligence, int dexterity, float x, float y, float z, float pitch, float yaw) { SetName(name); SetLastname(lastname); SetRace(race); SetGender(gender); SetFace(face); SetSkin(skin); SetZone(zone); SetHead("head"); SetChest("chest"); SetArms("arms"); SetHands("hands"); SetLegs("legs"); SetFeet("feet"); SetCloak("cloak"); SetNecklace("necklace"); SetRingOne("ringOne"); SetRingTwo("ringTwo"); SetRightHand("rightHand"); SetLeftHand("leftHand"); SetLevel(level); SetHp(hp); SetMaxHp(maxHp); SetBp(bp); SetMaxBp(maxBp); SetMp(mp); SetMaxMp(maxMp); SetEp(ep); SetMaxEp(maxEp); SetStrength(strength); SetConstitution(constitution); SetIntelligence(intelligence); SetDexterity(dexterity); SetX(x); SetY(y); SetZ(z); SetPitch(pitch); SetYaw(yaw); }
static int SettingChanged(WPARAM hContact, LPARAM lParam) { if (hContact == NULL) return 0; char *proto = GetContactProto(hContact); if (IsEmpty(proto)) return 0; DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; bool isProto = (strcmp(cws->szModule, proto) == 0); if (isProto && strcmp(cws->szSetting, "ApparentMode") == 0) { SetVisibility(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.wVal, true); return 0; } if (strcmp(cws->szSetting, "Gender") == 0 && (isProto || strcmp(cws->szModule, "UserInfo") == 0)) { SetGender(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal, true); return 0; } for (int i = 0; i < SIZEOF(infos); i++) { Info &p = infos[i]; for (int j = 0; j < SIZEOF(p.db); j += 2) { if (p.db[j + 1] == NULL) break; if (p.db[j] == NULL && !isProto) continue; if (p.db[j] != NULL && strcmp(cws->szModule, p.db[j])) continue; if (strcmp(cws->szSetting, p.db[j + 1])) continue; bool show = (cws->value.type != DBVT_DELETED && !IsEmpty(cws->value.pszVal)); ExtraIcon_SetIcon(p.hExtraIcon, hContact, show ? p.hIcolib : NULL); break; } } return 0; }
/*************************************************************************** * SetAll * ------------------------------------------------------------------------- * This method will set all private members * * Returns: All members will be assigned a value ***************************************************************************/ void Student::SetAll(string newName, string newStanding, string newNumber, long newId, unsigned short newAge, double newGpa, char newGender, int month, int day, int year) { //Calls all set methods to initialize all SetName (newName); SetStanding(newStanding); SetNumber (newNumber); SetId (newId); SetAge (newAge); SetGpa (newGpa); SetGender (newGender); SetAllDate(month, day, year); }
static void create() { leader::create(); SetKeyName("ixtala"); SetId("ixtala", "priest"); SetShort("Ix'Tala, high priestess of the Priests"); SetLong("Ix'Tala initiates priests into the Priests class as well as " "converts the wayward to the truth of the Dalin religion. " "To learn more about becoming a priest " "ask her to \"describe priests\". If you choose to become " "a priest, ask her to \"join priests\". Of course, you can " "convert by asking her to \"convert me\"."); SetLevel(45); SetRace("klingon"); SetClass("cleric"); SetGender("female"); SetMorality(400); SetReligion("Dalin", "Dalite"); SetProperty("no bump", 1); if( clonep() ) { AddChannel("priest"); } }
static void create() { vendor::create(); SetKeyName("shiela"); SetId("shiela", "vendor", "shop keeper", "keeper", "shopkeeper"); SetShort("Shiela, the local weapon vendor"); SetLong("She buys and sells weapons."); SetLevel(15); SetRace( "human"); SetGender("female"); SetMorality(40); SetListen("She has a very gruff voice."); AddCurrency("electrum", random(200)); // the room where she stores stuff to sell SetStorageRoom("/domains/Ylsrim"+ "/room/weaponry_storage"); // How good is she at being a vendor? Should be 100+ SetSkill("bargaining", 150); // This vendor belongs in a particular shop, don't bump her SetProperty("no bump", 1); // She takes electrum coins SetLocalCurrency("electrum"); // She buys weapons SetVendorType(VT_WEAPON); }