diff src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/store/transformer/DeleteChildAt.cs @ 0:dec15de2c6ff

first commit
author Kazuma
date Tue, 21 Jun 2016 17:11:12 +0900
parents
children
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/transformer/DeleteChildAt.cs	Tue Jun 21 17:11:12 2016 +0900
@@ -0,0 +1,34 @@
+using UnityEngine;
+using System.Collections;
+
+public class DeleteChildAt : NodeEditor {
+	private int pos;
+
+	public DeleteChildAt(int _pos)
+	{
+		pos = _pos;
+	}
+
+	public Either<Error, LoggingNode> _edit(LoggingNode logNode)
+	{
+		Either<Error,LoggingNode> either = logNode.getChildren().deleteChildAt(pos);
+		if(either.isA()){
+			// error
+			return either;
+		}
+		return DefaultEither<Error, LoggingNode>.newB(either.b());
+	}
+
+	public Either<Error, LoggingNode> edit(TreeNode _e) {
+		LoggingNode logNode = wrap(_e);
+		return _edit(logNode);
+	}
+
+	public LoggingNode wrap(TreeNode node) {
+		return new LoggingNode(node);
+	}
+
+	public LoggingNode wrap(TreeNode node, OperationLog op) {
+		return new LoggingNode(node, op);
+	}
+}