I want to convert Item to Item Object. My class item have atk point and hp point.
I want to convert Item to Item Object. My class item have atk point and hp point.
Can you provide any more context on this? Do you mean when you get results from the service, or copying elements from an object which is one class to an object which is of a different class? Generally speaking, some form of copy constructor would be used for the latter.
In my understanding, this method is right?
I'd have to say that I don't think this will work, as I'm seeing a mix of concepts. Can you provide more info on your "Item" class? In the code above, you're mapping CustomData, which is a string containing just the custom data elements of a single item in the catalog to an "Item" - can you provide more details on that class in your project? Generally speaking, an item instance is an instance in a player's inventory - not the generic catalog definition (or, in this case, the custom data of that definition). Also, I'm not sure what ObjectSlug is, or how the ItemDatabase is defined in the project. Can you please clarify these components?
Thank you for your suggestions. It's work!
2 People are following this question.