| 35 | } |
| 36 | |
| 37 | cResource* cResourceLib::AddResource(const cString& res_name) |
| 38 | { |
| 39 | if (m_initial_levels) return NULL; // Initial levels calculated, cannot add more resources |
| 40 | |
| 41 | const int new_id = m_resource_array.GetSize(); |
| 42 | cResource* new_resource = new cResource(res_name, new_id); |
| 43 | m_resource_array.Resize(new_id + 1); |
| 44 | m_resource_array[new_id] = new_resource; |
| 45 | |
| 46 | return new_resource; |
| 47 | } |
| 48 | |
| 49 | cResource* cResourceLib::GetResource(const cString& res_name) const |
| 50 | { |
no test coverage detected