view src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/store/operations/PutAttributeOperation.cs @ 0:dec15de2c6ff

first commit
author Kazuma
date Tue, 21 Jun 2016 17:11:12 +0900
parents
children 4d08270a61c8 02b2ab7bffe6
line wrap: on
line source

using UnityEngine;

public class PutAttributeOperation : NodeOperation {
	private string key;
	private GameObject value;

	public PutAttributeOperation(string _key,GameObject _value)
	{
		key = _key;
		value = _value;
	}


	public Command getCommand()
	{
		return Command.PUT_ATTRIBUTE;
	}

	public Either<Error,TreeNode> invoke(TreeNode _target)
	{
		return _target.getAttributes().put(key,value);
	}
	public int getPosition()
	{
		return -1;
	}

	public string getKey()
	{
		return key;
	}

	public GameObject getValue()
	{
		return value;
	}
}