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