20
|
1 using UnityEngine;
|
|
2 using System.Collections;
|
|
3 using System;
|
|
4
|
|
5 namespace JungleDB {
|
|
6 public class AppendChildAtOperation : NodeOperation {
|
|
7 private int pos;
|
|
8
|
|
9 public AppendChildAtOperation(int _pos)
|
|
10 {
|
|
11 pos = _pos;
|
|
12 }
|
|
13
|
|
14 public Command getCommand()
|
|
15 {
|
|
16 return Command.APPEND_CHILD;
|
|
17 }
|
|
18
|
|
19 public Either<Error,TreeNode> invoke(TreeNode _target)
|
|
20 {
|
|
21 return _target.getChildren().addNewChildAt(pos);
|
|
22 }
|
|
23
|
|
24 public int getPosition()
|
|
25 {
|
|
26 return pos;
|
|
27 }
|
|
28
|
|
29 public string getKey()
|
|
30 {
|
|
31 return null;
|
|
32 }
|
|
33
|
31
|
34 public object getValue()
|
20
|
35 {
|
31
|
36 return null;
|
20
|
37 }
|
|
38
|
|
39 }
|
|
40 }
|