Sync with L2JServer Jan 28th 2015.

This commit is contained in:
mobius
2015-01-29 05:18:04 +00:00
parent 59e1db4a68
commit 2cb3a52ed2
224 changed files with 4690 additions and 835 deletions

View File

@@ -23,13 +23,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javolution.util.FastMap;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.interfaces.IDeletable;
import com.l2jserver.gameserver.model.interfaces.IRestorable;
import com.l2jserver.gameserver.model.interfaces.IStorable;
/**
* @author UnAfraid
*/
public abstract class AbstractVariables extends StatsSet implements IRestorable, IStorable
public abstract class AbstractVariables extends StatsSet implements IRestorable, IStorable, IDeletable
{
private final AtomicBoolean _hasChanges = new AtomicBoolean(false);
@@ -84,6 +85,21 @@ public abstract class AbstractVariables extends StatsSet implements IRestorable,
super.set(name, value);
}
/**
* Put's entry to the variables and marks as changed if required (<i>Useful when restoring to do not save them again</i>).
* @param name
* @param value
* @param markAsChanged
*/
public final void set(String name, String value, boolean markAsChanged)
{
if (markAsChanged)
{
_hasChanges.compareAndSet(false, true);
}
super.set(name, value);
}
/**
* Return true if there exists a record for the variable name.
* @param name