|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
U% S0 U4 x4 n5 c9 wis
6 d7 D) }( ?! V- Q! Q a,b:integer;8 {6 J2 f' \& b( a: i* O
do
0 W0 V. ]9 s# C% g, r3 A: ?8 l0 o) J if store.cont.name="part1" then
z. ^! V+ ~- ^* M$ o/ A for a:=1 to 4 loop% p/ t8 E4 E+ U" T' H
store.cont.move;& Z# ?# n/ z# b
next;
' t5 h9 W) n' ]( k0 G0 `' `( C elseif store.cont.name="part2" then. y* V- B& v! e$ n8 b0 ^
for b:=1to 3 loop
: H! {3 X0 L& S1 S! ~ store.cont.move;
, m" v/ O; _ q+ O6 e1 g8 e/ [6 r next;
6 N0 G' O0 o, R5 v% P elseif store.cont.name="part3" then" q3 z0 I+ C4 I$ ~: j+ \
store.cont.move;
! \1 X$ K B& X: Y) f$ J+ w elseif store.cont.name="part4" then8 M% s3 y; |. ~5 z
store.cont.move;& }2 p; V+ M" z4 |1 o
end;+ W% C& c1 F) {( S( o
end; |
|