|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。2 n" P6 D" C: K5 [0 q
is
8 w5 E4 N7 W2 b' x# F( h4 c9 r a,b:integer;
0 ~& I. Z6 {( u" V+ |+ W1 s/ C. `5 }do! w4 M4 w: Y& x9 v2 e7 [
if store.cont.name="part1" then
; L2 t! k- [( _. S for a:=1 to 4 loop h4 j v3 e4 G
store.cont.move;: c; } t! ^" P. A7 c: G3 K
next;: X5 h1 }2 a% p3 T- t" h
elseif store.cont.name="part2" then. N Y' h; p" y C2 R. K
for b:=1to 3 loop
8 D% F( H$ c5 K& p" O7 u store.cont.move;
) Y' q$ d6 x: O' r, ~ next;8 }3 S& f2 G. v( p1 ^
elseif store.cont.name="part3" then
! \8 s5 R$ s, P: h" z! S store.cont.move;
! a; w( `* p' `8 R7 ]/ o elseif store.cont.name="part4" then
- F! X4 H3 }& s" A store.cont.move;% m9 _( X1 V/ F) c5 ~
end;3 T( o3 m5 G1 ^; [
end; |
|