diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/store/operations/PutAttributeOperation.cs	Tue Jun 21 17:11:12 2016 +0900
@@ -0,0 +1,37 @@
+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;
+	}
+}