0
|
1 using UnityEngine;
|
|
2
|
|
3 public class PutAttributeOperation : NodeOperation {
|
|
4 private string key;
|
6
|
5 private byte value;
|
0
|
6
|
6
|
7 public PutAttributeOperation(string _key, byte _value)
|
0
|
8 {
|
|
9 key = _key;
|
|
10 value = _value;
|
|
11 }
|
|
12
|
|
13
|
|
14 public Command getCommand()
|
|
15 {
|
|
16 return Command.PUT_ATTRIBUTE;
|
|
17 }
|
|
18
|
|
19 public Either<Error,TreeNode> invoke(TreeNode _target)
|
|
20 {
|
|
21 return _target.getAttributes().put(key,value);
|
|
22 }
|
|
23 public int getPosition()
|
|
24 {
|
|
25 return -1;
|
|
26 }
|
|
27
|
|
28 public string getKey()
|
|
29 {
|
|
30 return key;
|
|
31 }
|
|
32
|
6
|
33 public byte getValue()
|
0
|
34 {
|
|
35 return value;
|
|
36 }
|
|
37 }
|