41
|
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 }
|