Mercurial > hg > Database > jungle-sharp
changeset 41:bd44baa491a9 default tip
add TestJungleCore.cs
author | Kazuma Takeda |
---|---|
date | Thu, 23 Feb 2017 17:19:55 +0900 |
parents | db1d9ae4c4f6 |
children | |
files | Test/junge-main/TestJungleCore.cs |
diffstat | 1 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Test/junge-main/TestJungleCore.cs Thu Feb 23 17:19:55 2017 +0900 @@ -0,0 +1,25 @@ +using JungleDB; + +public class TestJungleCore { + public static int TrialCount = 10; + public static int HP = 10; + public static void Main () { + Jungle jungle = new DefaultJungle (null, "Game", new DefaultTreeEditor(new DefaultTraverser())); + JungleTree tree = jungle.createNewTree ("Scene"); + NodePath rootPath = new DefaultNodePath (); + JungleTreeEditor editor = tree.getTreeEditor (); + Either<Error, JungleTreeEditor> either = DefaultEither<Error, JungleTreeEditor>.newB (editor); + + for (int i = 0; i < TrialCount; i++) { + either.bind ((JungleTreeEditor arg) => { + return arg.putAttribute (rootPath ,"HP" + i, HP - i); + }); + } + + either.bind ((JungleTreeEditor arg) => { + return arg.commit(); + }); + editor = either.b (); + System.Console.WriteLine("Finish"); + } +}