|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
- s0 @: W a' ?& ?' B$ qis * c3 I4 h/ }9 o. [6 r6 h) g; R
a,b:integer;! A0 j" I1 g# Y9 B3 ]6 P
do
' z8 {! r2 m/ l: c$ c9 h if store.cont.name="part1" then) v3 j8 W# |3 r( K4 n, ]
for a:=1 to 4 loop
$ ^9 g! `" R& y0 o. M/ S store.cont.move;
) h0 \5 F9 x2 Q' F2 |# C4 J4 S+ y& Y next;
) {" J I) U- A' J6 |1 w elseif store.cont.name="part2" then
2 S+ N; ?) s; f/ v& H" N for b:=1to 3 loop" p+ g/ ]! |$ k$ `
store.cont.move;
4 |0 _ F$ l8 ^, ^ Q" s7 \ next;0 p/ E) K! H; M+ w$ B/ j
elseif store.cont.name="part3" then7 x/ n7 o2 ]; e3 g" I' ]
store.cont.move;
/ v4 T* W- m8 o# B' w3 X elseif store.cont.name="part4" then- b. h9 g9 Y3 b6 X( ]9 V
store.cont.move;
' i$ ~" y; f6 _' a) m6 ]4 D end;0 D( U! L( v5 J9 V4 U, s
end; |
|