Model Instances (cont.)
- It is obviously faster to store a model’s data the first time an instance of it is found, and have a way to retrieve it later
- However, since Model ID’s are not used any more, we need another way to “recognize” a Model
- Three possible techniques:
- Keep track of what Model objects you encounter, and store the SE_Object and the “parsed” data in a list. When you later encounter a GMI, you can do a search for the Model in your list by using the SE_ObjectsAreSame function.
- Similarly to above, but store the “parsed” data in the Model SE_Object by using SE_SetUserData. You can then retrieve the data using SE_GetUserData; no need to search for it.
- Instead of keeping the SE_Object, get the Object ID for the Model and get the string for the Object ID (SE_GetIDForObject and SE_ObjectIDToString). You can use the string as a hashing value to a table.
- The same techniques can be used for Image instances