|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
% c, d, Z: P$ K, |) c3 fis , Y. y& G& ]* @9 n( w3 A+ H: [
a,b:integer;, s2 V2 d- m+ T& o" ~
do* ?- |& P2 L1 Z$ E% M0 G
if store.cont.name="part1" then" n) b( |' K- M
for a:=1 to 4 loop" D4 ]) @; Q; H# t
store.cont.move;0 @, K7 `' c9 D. J7 S* Z
next;
5 k" h3 _" @& |% v: z- ?; r- R elseif store.cont.name="part2" then
3 B5 Z$ e6 C7 k, C! B# I, Z1 Q for b:=1to 3 loop
9 O: y9 K4 w' S. C" X! a) z store.cont.move;& U1 t2 Z+ ^! R+ {
next;$ ~+ x# A4 ~$ J) y! v. X
elseif store.cont.name="part3" then
, H. K( ?- Z. u' Y; E4 R- b7 M1 I2 G y store.cont.move;4 z9 B; @. k D( a: M) _
elseif store.cont.name="part4" then+ i2 {7 s+ W/ o
store.cont.move;' a. P" y; F; ^' ~9 c
end;! W. l9 V8 j6 z# H9 T% L, k
end; |
|