Mercurial > hg > Database > jungle-sharp
comparison Main/jungle-main/store/transformer/AppendChildAt.cs @ 20:1f99e150f336
fix folder and add Object Mapper.
author | Kazuma Takeda |
---|---|
date | Thu, 15 Dec 2016 22:52:48 +0900 |
parents | |
children | f2ea780b3e80 |
comparison
equal
deleted
inserted
replaced
19:0865819106cf | 20:1f99e150f336 |
---|---|
1 using UnityEngine; | |
2 using System.Collections; | |
3 | |
4 namespace JungleDB { | |
5 public class AppendChildAt : NodeEditor { | |
6 private int pos; | |
7 | |
8 public AppendChildAt(int _pos){ | |
9 pos = _pos; | |
10 } | |
11 | |
12 public Either<Error, LoggingNode> _edit(LoggingNode _e) | |
13 { | |
14 Either<Error,LoggingNode> either = _e.getChildren().addNewChildAt(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 } | |
35 } |