|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
3 @; r# i6 r8 ?3 r2 d; Xis
4 x o7 K0 v/ g+ I a,b:integer;+ J1 I0 x% Q* C) Q: k- s6 k9 `6 p
do
- k& X& W/ E8 }) c, C9 \: d if store.cont.name="part1" then, B5 d) y' ^6 x) ?
for a:=1 to 4 loop r7 C- U8 C5 ^: j' d
store.cont.move;% P. {! e( w" c% l( H" o: h7 P; x
next;
1 \+ Z; v2 w$ c& ]) W elseif store.cont.name="part2" then
/ W" I# n1 d! o4 x for b:=1to 3 loop0 d5 a! g6 O: M: t7 @
store.cont.move;! f+ z0 P+ P( }; Q b3 ]/ d
next;1 q% J0 X9 Q$ x" ~6 q% t5 d
elseif store.cont.name="part3" then! E# L! i* {9 t4 ?
store.cont.move;' x& i; U% P+ Y( C
elseif store.cont.name="part4" then0 d+ |. D& y- y- G; G$ c8 A6 h
store.cont.move;
( M/ `( \& _- ^# o- D end;. T: T# O6 h! V5 Y0 a& W
end; |
|