comparison src/test/csharp/jp.ac.u-ryukyu.ie.cr/jungle-network/operations/NetworkTreeOperationLogTest.cs @ 13:4c8932dad7b2

Add Test and only NetworkTreeOperationLogTest.cs not work.
author Kazuma
date Sun, 23 Oct 2016 13:35:21 +0900
parents
children
comparison
equal deleted inserted replaced
12:b71d9ea6bd8e 13:4c8932dad7b2
1 using UnityEngine;
2 using System.Collections;
3 using MsgPack;
4
5 public class NetworkTreeOperationLogTest : MonoBehaviour {
6
7 // Use this for initialization
8 void Start () { // not work yet 10/23 13:33
9 NetworkAppendChildAtOperation op = new NetworkAppendChildAtOperation(1);
10 NetworkNodePath path = new NetworkNodePath();
11 NodePath npath = path.add(1).add(2);
12 NetworkTreeOperationLog log = new NetworkTreeOperationLog();
13 log.add(npath, op);
14 log.add(npath, op);
15 ObjectPacker pack = new ObjectPacker();
16 byte[] value = pack.Pack(log);
17
18 // unpackage
19 ObjectPacker unpack = new ObjectPacker();
20 NetworkTreeOperationLog mOp = unpack.Unpack<NetworkTreeOperationLog>(value);
21 foreach (var m in mOp) {
22 print(m.getNodePath().size());
23 print(m.getNodeOperation());
24 }
25 }
26 }