|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
9 J: t# |; [! d9 g/ fis % M9 L( G' a( @
a,b:integer;
1 U; I5 Y; L% ldo$ U5 w8 p" \5 X2 b$ E
if store.cont.name="part1" then
& }! v4 b% T7 [/ R8 t( b8 u for a:=1 to 4 loop' i6 k& `3 `, N3 h4 i
store.cont.move;
9 O- K& K8 `$ C# o* V$ g next;" z d, I( g" a- L5 \& ~" F+ w8 V
elseif store.cont.name="part2" then" h4 U& z, e+ d3 a0 O0 S4 q
for b:=1to 3 loop
$ B+ P/ \. B6 M! h: ^! ]2 c( h store.cont.move;/ M/ |# m. R- [3 X
next;
) }; k- j+ z0 M( F$ k Y" y elseif store.cont.name="part3" then
6 |7 f3 D, d( Q+ H' B% F store.cont.move;* [' r/ M+ u2 |
elseif store.cont.name="part4" then
+ F; W& p) V" l( s& V! r( D: P6 f store.cont.move;) r# j* W- q" ?
end;
7 S' G! A9 p4 `; `* V( O end; |
|