Rev: 5339 - 2012/05/12 [Interlude]
i was looking for a function to return the item type, after a little research i found this one:
public boolean isConsumable()
{
return false;
}
haha that's funny, it's like, "hey, can i consume that? [NO]" xDD
Things which doesn't have sense
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- UnAfraid
- L2j Veteran
- Posts: 4199
- Joined: Mon Jul 23, 2007 4:25 pm
- Location: Bulgaria
- Contact:
- BiggBoss
- L2j Veteran
- Posts: 1104
- Joined: Wed Apr 15, 2009 3:11 pm
- Location: Spain
Re: Things which doesn't have sense
an example
http://svn.l2jserver.com/branches/L2_Ga ... cItem.java
http://svn.l2jserver.com/branches/L2_Ga ... cItem.java
Code: Select all
@Override public final boolean isConsumable() { return ((getItemType() == L2EtcItemType.SHOT) || (getItemType() == L2EtcItemType.POTION)); // || (type == L2EtcItemType.SCROLL)); }
-
- Posts: 3
- Joined: Thu Jan 05, 2012 2:41 am
Re: Things which doesn't have sense
yeah, know, but i usually do:
-------------
....
var _isConsumable = false;
fn public/protected bool IsConsumable(){ return _isConsumable; }
fn public/protected void IsConsumable(bool b){ _isConsumable = b; }
...
--------------
pd. there is no reason to offend any of the developers.
just 2 different ways to do something, and on my mind was funny in pseudo-code
-------------
....
var _isConsumable = false;
fn public/protected bool IsConsumable(){ return _isConsumable; }
fn public/protected void IsConsumable(bool b){ _isConsumable = b; }
...
--------------
pd. there is no reason to offend any of the developers.
just 2 different ways to do something, and on my mind was funny in pseudo-code
- UnAfraid
- L2j Veteran
- Posts: 4199
- Joined: Mon Jul 23, 2007 4:25 pm
- Location: Bulgaria
- Contact:
Re: Things which doesn't have sense
What if you have thousands of instances of that class u gonna allocate variable for each when u need it just for few hundreds.
-
- Posts: 3
- Joined: Thu Jan 05, 2012 2:41 am
Re: Things which doesn't have sense
bool = 1byte, why not?
Anyway, the purpose of this topic is not to offend anyone.
- I apologize to those i have offended, it is not intended.
Anyway, the purpose of this topic is not to offend anyone.
- I apologize to those i have offended, it is not intended.