|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
2 B- c7 L8 C. C. x8 Yis - R5 C) v" Z. l1 X9 G5 j6 L" u
a,b:integer;2 g) N2 X$ H4 `6 V1 R
do
( P" h" _+ O4 B/ f" w3 { if store.cont.name="part1" then
: p v8 `' ^' X4 q i+ q for a:=1 to 4 loop
& @+ T9 U- U( x store.cont.move;
; e: {) Q4 t0 P' Q next;
w/ c( J% e+ B' \7 f elseif store.cont.name="part2" then' w3 {1 Q; I: T' x$ h
for b:=1to 3 loop" ^4 i, k0 y% P3 o
store.cont.move;
/ z( y5 X2 [% f next;
V- r/ Z3 S9 W: a/ r elseif store.cont.name="part3" then
/ a* M0 o. ~6 [& R9 M$ ] store.cont.move;3 l# G1 Y2 `# I% i$ i% v
elseif store.cont.name="part4" then
. g. B9 T2 W! F0 ] store.cont.move; s1 @+ \5 \, u: L; H0 S+ [
end;; p/ @9 }8 x0 c, {) D
end; |
|