/* ************************************************************************
#
#  DivConq
#
#  http://divconq.com/
#
#  Copyright:
#    Copyright 2012 eTimeline, LLC. All rights reserved.
#
#  License:
#    See the license.txt file in the project's top-level directory for details.
#
#  Authors:
#    * Andy White
#
************************************************************************ */
package divconq.script.mutator;

import divconq.script.Activity;
import divconq.script.IMutator;
import divconq.script.StackEntry;
import divconq.struct.Struct;
import divconq.struct.scalar.IntegerStruct;
import divconq.xml.XElement;

public class DecMutator implements IMutator {

	@Override
	public void mutate(Activity activity, StackEntry stack, XElement code, Struct dest) {
		if (dest instanceof IntegerStruct) {
			IntegerStruct idest = (IntegerStruct)dest;
			idest.setValue(idest.getValue() - 1);
		}
		
		// TODO other types
	}
}
