Mercurial > hg > Members > nobuyasu > Alice > DPPAlice
changeset 24:edd9ced13896
change method name from getFork to takeFork
author | one |
---|---|
date | Mon, 10 Dec 2012 00:47:57 +0900 |
parents | da62aa1f4d87 |
children | f77f0bb99f35 80023cb92594 |
files | src/alice/test/dpp/codesegment/philosophy/TakeForkCodeSegment.java src/alice/test/dpp/codesegment/philosophy/TakeLeftForkCodeSegment.java src/alice/test/dpp/codesegment/philosophy/TakeRightForkCodeSegment.java src/alice/test/dpp/datasegment/Fork.java |
diffstat | 4 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/test/dpp/codesegment/philosophy/TakeForkCodeSegment.java Mon Dec 10 00:22:41 2012 +0900 +++ b/src/alice/test/dpp/codesegment/philosophy/TakeForkCodeSegment.java Mon Dec 10 00:47:57 2012 +0900 @@ -29,7 +29,7 @@ Fork leftFork = arg3.asClass(Fork.class); System.out.println(phil.getName() + " is trying to take the fork."); - if (leftFork.getFork(phil.getName()) && rightFork.getFork(phil.getName()) ) { + if (leftFork.takeFork(phil.getName()) && rightFork.takeFork(phil.getName()) ) { phil.setState(Philosophy.State.EAT); } else { leftFork.onTheTable(phil.getName());
--- a/src/alice/test/dpp/codesegment/philosophy/TakeLeftForkCodeSegment.java Mon Dec 10 00:22:41 2012 +0900 +++ b/src/alice/test/dpp/codesegment/philosophy/TakeLeftForkCodeSegment.java Mon Dec 10 00:47:57 2012 +0900 @@ -21,7 +21,7 @@ Philosophy phil = arg1.asClass(Philosophy.class); Fork fork = arg2.asClass(Fork.class); System.out.println(phil.getName() + " take left fork."); - if (fork.getFork(phil.getName())) { + if (fork.takeFork(phil.getName())) { phil.setState(Philosophy.State.EAT); new EatCodeSegment(phil.getName()); } else {
--- a/src/alice/test/dpp/codesegment/philosophy/TakeRightForkCodeSegment.java Mon Dec 10 00:22:41 2012 +0900 +++ b/src/alice/test/dpp/codesegment/philosophy/TakeRightForkCodeSegment.java Mon Dec 10 00:47:57 2012 +0900 @@ -20,7 +20,7 @@ public void run() { Philosophy phil = arg1.asClass(Philosophy.class); Fork fork = arg2.asClass(Fork.class); - if (fork.getFork(phil.getName())) { + if (fork.takeFork(phil.getName())) { phil.setState(Philosophy.State.TAKELEFTFORK); new TakeLeftForkCodeSegment(phil.getName(), phil.getLeftFork()); } else {
--- a/src/alice/test/dpp/datasegment/Fork.java Mon Dec 10 00:22:41 2012 +0900 +++ b/src/alice/test/dpp/datasegment/Fork.java Mon Dec 10 00:47:57 2012 +0900 @@ -35,7 +35,7 @@ return forkName; } - public boolean getFork(String pName) { + public boolean takeFork(String pName) { if (state == State.ON_THE_TABLE) { state = State.IN_THE_HAND; owner = pName;