| 47 | } |
| 48 | |
| 49 | bool CProfessionManager::ParseFilePart(TextFileParser &file) |
| 50 | { |
| 51 | PROFESSION_TYPE type = PT_NO_PROF; |
| 52 | std::vector<astr_t> childrens; |
| 53 | astr_t name{}; |
| 54 | astr_t trueName{}; |
| 55 | uint32_t nameClilocID = 0; |
| 56 | uint32_t descriptionClilocID = 0; |
| 57 | int descriptionIndex = 0; |
| 58 | uint16_t gump = 0; |
| 59 | bool topLevel = false; |
| 60 | int skillCount = 0; |
| 61 | int skillIndex[4] = { 0xFF, 0xFF, 0xFF, 0xFF }; |
| 62 | int skillValue[4] = { 0, 0, 0, 0 }; |
| 63 | int stats[3] = { 0 }; |
| 64 | |
| 65 | bool exit = false; |
| 66 | while (!file.IsEOF() && !exit) |
| 67 | { |
| 68 | std::vector<astr_t> strings = file.ReadTokens(); |
| 69 | |
| 70 | if (strings.empty()) |
| 71 | { |
| 72 | continue; |
| 73 | } |
| 74 | |
| 75 | int code = GetKeyCode(strings[0]); |
| 76 | switch (code) |
| 77 | { |
| 78 | case PM_CODE_BEGIN: |
| 79 | case PM_CODE_END: |
| 80 | { |
| 81 | exit = true; |
| 82 | break; |
| 83 | } |
| 84 | case PM_CODE_NAME: |
| 85 | { |
| 86 | name = strings[1]; |
| 87 | break; |
| 88 | } |
| 89 | case PM_CODE_TRUENAME: |
| 90 | { |
| 91 | trueName = strings[1]; |
| 92 | break; |
| 93 | } |
| 94 | case PM_CODE_DESC: |
| 95 | { |
| 96 | descriptionIndex = str_to_int(strings[1]); |
| 97 | break; |
| 98 | } |
| 99 | case PM_CODE_TOPLEVEL: |
| 100 | { |
| 101 | topLevel = (GetKeyCode(strings[1]) == PM_CODE_TRUE); |
| 102 | break; |
| 103 | } |
| 104 | case PM_CODE_GUMP: |
| 105 | { |
| 106 | gump = str_to_int(strings[1]); |
nothing calls this directly
no test coverage detected