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