annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
1 using UnityEngine;
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
2 using System.Collections;
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
3 using MsgPack;
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
4
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
5 public class NetworkTreeOperationLogTest : MonoBehaviour {
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
6
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
7 // Use this for initialization
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
8 void Start () { // not work yet 10/23 13:33
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
9 NetworkAppendChildAtOperation op = new NetworkAppendChildAtOperation(1);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
10 NetworkNodePath path = new NetworkNodePath();
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
11 NodePath npath = path.add(1).add(2);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
12 NetworkTreeOperationLog log = new NetworkTreeOperationLog();
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
13 log.add(npath, op);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
14 log.add(npath, op);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
15 ObjectPacker pack = new ObjectPacker();
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
16 byte[] value = pack.Pack(log);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
17
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
18 // unpackage
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
19 ObjectPacker unpack = new ObjectPacker();
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
20 NetworkTreeOperationLog mOp = unpack.Unpack<NetworkTreeOperationLog>(value);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
21 foreach (var m in mOp) {
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
22 print(m.getNodePath().size());
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
23 print(m.getNodeOperation());
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
24 }
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
25 }
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
26 }