Page 1 of 1

Question regarding spoil methods

Posted: Mon Jan 05, 2015 11:19 am
by sahar
In L2Attackable is there a reason we got this:

Code: Select all

	private boolean _isSpoil = false;
	private int _isSpoiledBy = 0;
	
	public boolean isSpoil()
	{
		return _isSpoil;
	}
	
	public void setSpoil(boolean isSpoil)
	{
		_isSpoil = isSpoil;
	}
	
	public final int getIsSpoiledBy()
	{
		return _isSpoiledBy;
	}
	
	public final void setIsSpoiledBy(int value)
	{
		_isSpoiledBy = value;
	}
Rather than just this:

Code: Select all

	private int _isSpoiledBy = 0;
	
	public boolean isSpoil()
	{
		return _isSpoiledBy > 0;
	}
	
	public final int getIsSpoiledBy()
	{
		return _isSpoiledBy;
	}
	
	public final void setIsSpoiledBy(int value)
	{
		_isSpoiledBy = value;
	}

Re: Question regarding spoil methods

Posted: Mon Jan 05, 2015 3:42 pm
by jurchiks
That's called "Advanced coding skills" :D
Anyway, it should be _spoiledBy, "is" prefix is meant for boolean variables/methods only (like isSpoil()).

Re: Question regarding spoil methods

Posted: Thu Jan 15, 2015 4:34 pm
by sahar
Another thing I came accross, if x do y and then do y again anyway...

Code: Select all

if (stackedInfo.getSkill().isAbnormalInstant())
{
	stopSkillEffects(false, skill.getAbnormalType());
}
stopSkillEffects(false, skill.getAbnormalType());
in CharEffectList.java

Re: Question regarding spoil methods

Posted: Thu Jan 15, 2015 4:37 pm
by Sdw
Dude you don't know what you just did :D

Re: Question regarding spoil methods

Posted: Thu Jan 15, 2015 4:43 pm
by sahar
Huh? is it bad? ;p