comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:dec15de2c6ff
1 using UnityEngine;
2 using System.Collections;
3
4 public class DeleteChildAt : NodeEditor {
5 private int pos;
6
7 public DeleteChildAt(int _pos)
8 {
9 pos = _pos;
10 }
11
12 public Either<Error, LoggingNode> _edit(LoggingNode logNode)
13 {
14 Either<Error,LoggingNode> either = logNode.getChildren().deleteChildAt(pos);
15 if(either.isA()){
16 // error
17 return either;
18 }
19 return DefaultEither<Error, LoggingNode>.newB(either.b());
20 }
21
22 public Either<Error, LoggingNode> edit(TreeNode _e) {
23 LoggingNode logNode = wrap(_e);
24 return _edit(logNode);
25 }
26
27 public LoggingNode wrap(TreeNode node) {
28 return new LoggingNode(node);
29 }
30
31 public LoggingNode wrap(TreeNode node, OperationLog op) {
32 return new LoggingNode(node, op);
33 }
34 }