Mercurial > hg > Members > nobuyasu > Alice > DPPAlice
comparison src/alice/test/dpp/codesegment/philosophy/EatCodeSegment.java @ 23:da62aa1f4d87
hg rename codesegment package
author | one |
---|---|
date | Mon, 10 Dec 2012 00:22:41 +0900 |
parents | src/alice/test/dpp/codesegment/EatCodeSegment.java@6018e62cb198 |
children | f77f0bb99f35 |
comparison
equal
deleted
inserted
replaced
22:fd370b35fac1 | 23:da62aa1f4d87 |
---|---|
1 package alice.test.dpp.codesegment.philosophy; | |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.Receiver; | |
6 import alice.test.dpp.datasegment.Philosophy; | |
7 | |
8 public class EatCodeSegment extends CodeSegment { | |
9 | |
10 Receiver arg1 = ids.create(CommandType.TAKE); | |
11 | |
12 public EatCodeSegment(String pName) { | |
13 arg1.setKey(pName); | |
14 } | |
15 | |
16 @Override | |
17 public void run() { | |
18 Philosophy phil = arg1.asClass(Philosophy.class); | |
19 System.out.println(phil.getName() + " is eating."); | |
20 phil.setState(Philosophy.State.PUTRIGHTFORK); | |
21 new PutRightForkCodeSegment(phil.getName(), phil.getRightFork()); | |
22 ods.update("local", phil.getName(), phil); | |
23 } | |
24 } |