Mercurial > hg > Database > jungle-sharp
comparison Test/junge-main/TestJungleCore.cs @ 41:bd44baa491a9 default tip
add TestJungleCore.cs
author | Kazuma Takeda |
---|---|
date | Thu, 23 Feb 2017 17:19:55 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
40:db1d9ae4c4f6 | 41:bd44baa491a9 |
---|---|
1 using JungleDB; | |
2 | |
3 public class TestJungleCore { | |
4 public static int TrialCount = 10; | |
5 public static int HP = 10; | |
6 public static void Main () { | |
7 Jungle jungle = new DefaultJungle (null, "Game", new DefaultTreeEditor(new DefaultTraverser())); | |
8 JungleTree tree = jungle.createNewTree ("Scene"); | |
9 NodePath rootPath = new DefaultNodePath (); | |
10 JungleTreeEditor editor = tree.getTreeEditor (); | |
11 Either<Error, JungleTreeEditor> either = DefaultEither<Error, JungleTreeEditor>.newB (editor); | |
12 | |
13 for (int i = 0; i < TrialCount; i++) { | |
14 either.bind ((JungleTreeEditor arg) => { | |
15 return arg.putAttribute (rootPath ,"HP" + i, HP - i); | |
16 }); | |
17 } | |
18 | |
19 either.bind ((JungleTreeEditor arg) => { | |
20 return arg.commit(); | |
21 }); | |
22 editor = either.b (); | |
23 System.Console.WriteLine("Finish"); | |
24 } | |
25 } |