|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。: l: P' [- J7 ]4 p( S
is
+ m0 I/ E. ?4 c( G/ }- ^ a,b:integer;
k3 y* ~9 e; C% Z3 l9 B: `do0 I. o% T: w. E% ~' d" z1 e
if store.cont.name="part1" then. [% Y& D5 e: n% S+ ~
for a:=1 to 4 loop" U; ?8 G' ~2 C
store.cont.move;9 S/ p! j5 \1 s4 W2 P
next;
2 L5 Y" _' a' d' Z elseif store.cont.name="part2" then
! n- u5 b' V2 p h: U for b:=1to 3 loop
1 |) M2 r* G! l& ~* L y8 K store.cont.move;0 P/ r4 M0 h+ l( V2 T- X$ B
next;9 @- e" d8 @7 ?) S4 R6 _' c
elseif store.cont.name="part3" then, O9 a! }; T/ y8 A6 b( U( @# n) r& k1 q
store.cont.move;& C3 D h/ j: v6 d& t( D5 S' d
elseif store.cont.name="part4" then& V/ {( e1 Y. A2 d
store.cont.move;
2 T2 z7 y: H' u2 u end; f* x6 n! }5 w" O9 N
end; |
|