Mercurial > hg > Members > nobuyasu > Alice > DPPAlice
view src/alice/test/dpp/codesegment/EatCodeSegment.java @ 15:7e91e919a7de
modified
author | one |
---|---|
date | Sun, 09 Dec 2012 22:09:46 +0900 (2012-12-09) |
parents | 33727db069c2 |
children | 92cde6277018 |
line wrap: on
line source
package alice.test.dpp.codesegment; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; import alice.test.dpp.model.Philosophy; public class EatCodeSegment extends CodeSegment { Receiver arg1 = ids.create(CommandType.TAKE); public EatCodeSegment(String pName) { arg1.setKey(pName); } @Override public void run() { Philosophy phil = arg1.asClass(Philosophy.class); System.out.println(phil.getName() + " is eating."); phil.setState(Philosophy.State.PUTFORK); new ScheduleCodeSegment(phil.getName()); ods.update("local", phil.getName(), phil); } }