Mercurial > hg > Database > jungle-sharp
comparison src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle-main/store/transformer/PutAttribute.cs @ 10:abe0c247f5a5
Add Network module. but, unComplete NetworkDefaultJungleTreeEditor.cs
author | Kazuma Takeda <kazuma-arashi@hotmail.co.jp> |
---|---|
date | Sun, 23 Oct 2016 07:40:50 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9:e6ad9016601c | 10:abe0c247f5a5 |
---|---|
1 using UnityEngine; | |
2 using System.Collections; | |
3 | |
4 public class PutAttribute : NodeEditor { | |
5 private string key; | |
6 private byte[] value; | |
7 | |
8 public PutAttribute(string _key, byte[] _value) | |
9 { | |
10 key = _key; | |
11 value = _value; | |
12 } | |
13 | |
14 public Either<Error,LoggingNode> _edit(LoggingNode _e) | |
15 { | |
16 Either<Error,LoggingNode> either = _e.getAttributes().put(key,value); | |
17 if(either.isA()){ | |
18 // error | |
19 return either; | |
20 } | |
21 return DefaultEither<Error, LoggingNode>.newB(either.b()); | |
22 } | |
23 | |
24 public Either<Error, LoggingNode> edit(TreeNode _e) { | |
25 LoggingNode logNode = wrap(_e); | |
26 return _edit(logNode); | |
27 } | |
28 | |
29 public LoggingNode wrap(TreeNode node) { | |
30 return new LoggingNode(node); | |
31 } | |
32 | |
33 public LoggingNode wrap(TreeNode node, OperationLog op) { | |
34 return new LoggingNode(node, op); | |
35 } | |
36 } |