|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。0 Z9 Z/ @+ k+ Q2 `# _
is
3 Y% y+ w0 j3 ?9 [+ c a,b:integer;- f9 b) }# r" _3 k1 q9 _/ n
do7 L2 M/ N/ R2 A
if store.cont.name="part1" then9 D U, _+ w3 _9 x; Z. J, Z* M
for a:=1 to 4 loop
; y$ ?4 J$ H& B+ h+ O {0 I store.cont.move;
0 D( G& ~- Q, D" ^% S next;2 Q* @; ^3 I% W D( N. l1 s4 K
elseif store.cont.name="part2" then
$ A% x+ S8 A& w* S for b:=1to 3 loop
, ]7 `. g5 k" d$ S2 i, e store.cont.move;
( c4 X' e" n. y/ D( A; p next;( `6 t3 s7 r6 w: j% ^7 C
elseif store.cont.name="part3" then$ I# q6 n# {3 k" ~; j& C& o8 N5 Q" o+ B
store.cont.move;/ u$ ^- ~' t* |* I
elseif store.cont.name="part4" then
0 o+ o: d" p# t store.cont.move;
- C, U, M6 f: Q+ M2 Z end;
3 u' F) n7 B1 A7 g end; |
|