|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
9 g: a$ e( Y3 N: lis
& K7 c' S% m! E- \0 h8 ~ a,b:integer;8 w) E' @: \- u, K
do
; { G. s7 K4 X; V if store.cont.name="part1" then U: F' p! l2 M) F$ Z/ X: C
for a:=1 to 4 loop. P( |. ^6 Y5 d1 X/ k; W
store.cont.move;) _+ ] W1 N+ p/ A+ C. v; _! Q/ K
next;
: I1 I! ?; w& n( F | elseif store.cont.name="part2" then
( Y! \1 e! L9 d& _ for b:=1to 3 loop
) K5 e( D# j. F0 ]: N: _ store.cont.move;
2 u, ~! E: q9 l9 B) y9 f* C next;
* H7 A! V: l9 l1 }3 G: G elseif store.cont.name="part3" then, @/ B8 X7 [5 d% H6 I1 |9 ]4 ?/ c
store.cont.move;
( }9 s1 ^/ | Y. W9 H elseif store.cont.name="part4" then( y" b+ j; D: D' O0 {9 n9 V0 }* V
store.cont.move;- y; Y0 r) t$ E* f
end;4 P* Q0 Y: G3 c) ^# b, q
end; |
|