Greetings people, I've got a question that I'd really like to answer by myself but I've only got basic java knowledge. Recently, I decided to categorise some custom made items. Here's an example of the method I chose to do it:
//This code was written inside L2ItemInstance class
public boolean isCustomItem()
{
switch(getId())
{
case 1311: //random item
case 2244: //random item
case 3554: //random item
return true;
}
return false;
}
This works completely fine but it seems pretty sloppy.
Now, I understand that there is another way of doing it through L2Item instead of L2ItemInstance class by creating booleans, updating StatsSet and working on xmls by adding the custom boolean to the respective items. However, I really can't tell whats the difference in terms of coding efficiency and reliability (if there is any). Has any of you fellows got this sorted out? Which way would you choose? Maybe another way not mentioned here? Thanks!
Question
Meydex
Greetings people,
I've got a question that I'd really like to answer by myself but I've only got basic java knowledge.
Recently, I decided to categorise some custom made items. Here's an example of the method I chose to do it:
This works completely fine but it seems pretty sloppy.
Now, I understand that there is another way of doing it through L2Item instead of L2ItemInstance class by creating booleans, updating StatsSet and working on xmls by adding the custom boolean to the respective items.
However, I really can't tell whats the difference in terms of coding efficiency and reliability (if there is any).
Has any of you fellows got this sorted out?
Which way would you choose? Maybe another way not mentioned here?
Thanks!
7 answers to this question
Recommended Posts