|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
e5 @5 F% K2 [* {- A/ his % P, O$ w4 I0 y
a,b:integer;/ f7 W( E- f& j9 ^( j5 h
do, I Y' J0 P8 {$ E
if store.cont.name="part1" then
, s9 A Q2 d* ]( _# A* g for a:=1 to 4 loop
9 I- v) k& Y: u1 g& u store.cont.move;
2 {) s+ S6 D, v3 A+ S next;0 o# u) ?4 f: Y% M
elseif store.cont.name="part2" then
2 p3 T; d+ q7 ]6 X# p/ c) e5 d# d for b:=1to 3 loop' j; D6 R" W; u7 Q' j
store.cont.move;5 Y1 }- p9 o6 p
next;
) s3 s& h) z) C0 Q" S elseif store.cont.name="part3" then
8 s1 l+ m8 z: L# W8 y6 U store.cont.move;1 m o) E+ Q; A6 l" K$ N
elseif store.cont.name="part4" then) U% B4 [( L m1 E- M, V
store.cont.move;
$ }( {' f& k6 P3 _ end;
/ C" [8 h# K0 N* r end; |
|