# HG changeset patch # User one # Date 1353832422 -32400 # Node ID f7af6388adbbcc0dbd58d3e62edff6625aacdc3e # Parent b59c04a332a1971b02aa02ce6f92795ca56f45bd modified Fork.java diff -r b59c04a332a1 -r f7af6388adbb src/alice/test/dpp/codesegment/PutForkCodeSegment.java --- a/src/alice/test/dpp/codesegment/PutForkCodeSegment.java Sun Nov 25 17:22:45 2012 +0900 +++ b/src/alice/test/dpp/codesegment/PutForkCodeSegment.java Sun Nov 25 17:33:42 2012 +0900 @@ -25,6 +25,8 @@ Fork rightFork = arg2.asClass(Fork.class); leftFork.onTheTable(phil); rightFork.onTheTable(phil); + ods.update("local", leftFork.getForkName(), leftFork); + ods.update("local", rightFork.getForkName(), rightFork); new ThinkCodeSegment(phil); } diff -r b59c04a332a1 -r f7af6388adbb src/alice/test/dpp/model/Fork.java --- a/src/alice/test/dpp/model/Fork.java Sun Nov 25 17:22:45 2012 +0900 +++ b/src/alice/test/dpp/model/Fork.java Sun Nov 25 17:33:42 2012 +0900 @@ -1,18 +1,27 @@ package alice.test.dpp.model; +import org.msgpack.annotation.Message; + +@Message public class Fork { + private final String forkName; private String owner; - private String forkName; - private ForkState state; + private State state; + + @Message + public enum State { + ON_THE_TABLE, + IN_THE_HAND; + } public Fork(String n) { forkName = n; owner = Table.TABLE; - state = ForkState.ON_THE_TABLE; + state = State.ON_THE_TABLE; } - public ForkState getState() { + public State getState() { return state; } @@ -21,8 +30,8 @@ } public boolean getFork(Philosophy phil) { - if (state == ForkState.ON_THE_TABLE){ - state = ForkState.IN_THE_HAND; + if (state == State.ON_THE_TABLE){ + state = State.IN_THE_HAND; owner = phil.getName(); return true; } else { @@ -32,7 +41,7 @@ public boolean onTheTable(Philosophy phil) { if (owner.equals(phil.getName())) { - state = ForkState.ON_THE_TABLE; + state = State.ON_THE_TABLE; owner = Table.TABLE; return true; } else { diff -r b59c04a332a1 -r f7af6388adbb src/alice/test/dpp/model/ForkState.java --- a/src/alice/test/dpp/model/ForkState.java Sun Nov 25 17:22:45 2012 +0900 +++ b/src/alice/test/dpp/model/ForkState.java Sun Nov 25 17:33:42 2012 +0900 @@ -1,11 +1,11 @@ package alice.test.dpp.model; +import org.msgpack.annotation.Message; + +@Message public enum ForkState { - ON_THE_TABLE, IN_THE_HAND; - - }