|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
- D- f( U3 ]8 r0 J$ }4 uis
' i$ X: u- n, V0 f a,b:integer;, X0 e4 m- p" m+ d S5 |
do3 X5 X+ r! E$ j$ [3 O! t
if store.cont.name="part1" then2 U) V" a# y& u: x
for a:=1 to 4 loop
: N2 V2 V9 f7 c! L7 t3 y: ? store.cont.move;
. z& z' D W+ Z7 n5 m( y# B next;
$ Z# U( S' P8 |5 ?2 W( c) ?; } elseif store.cont.name="part2" then; Y5 Z! L7 m$ r9 j5 d
for b:=1to 3 loop$ E( _- s2 L$ O }1 N c; U
store.cont.move;
3 \- t) ]) i* b: b5 _4 z8 ]0 i: L* Z next;
8 [, g( D6 X3 {) F( K elseif store.cont.name="part3" then7 ]% Z' {5 ]5 E U+ u8 w
store.cont.move;5 B, Y/ c5 O1 n* I4 ?
elseif store.cont.name="part4" then
7 x0 f7 A2 e( S store.cont.move;
5 Z9 Q7 Z. g% M% a4 U end;
, S" x8 h. P+ R% c end; |
|