|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
" {% J2 |' g, R3 eis
3 J* F+ r) [7 p6 `' n a,b:integer;
; r. M3 D6 [8 Z1 M$ q' h5 z, O9 tdo1 C* F, Y) ?: z& X
if store.cont.name="part1" then
% ^, b$ z5 H. ]; U* { for a:=1 to 4 loop
! V; I, J7 P* M, ?4 @ store.cont.move;! H/ y+ L- ^2 B7 D' f
next;& P# T" Q+ w- e1 j j8 {* o) j
elseif store.cont.name="part2" then
- y2 i; j) T e4 [ for b:=1to 3 loop7 N+ w# d! R: K. Z/ ~) Y
store.cont.move;
6 ^1 E$ ?. Q3 L, P next;
j+ _# g' G6 S4 C! }) k8 f elseif store.cont.name="part3" then% a2 I4 z( B+ x/ y
store.cont.move;
: ~/ t/ {1 \% O6 r% L7 k4 w7 D" O elseif store.cont.name="part4" then
: d4 n, A, x. Q. d store.cont.move;
' i6 j1 N6 j" Y1 R end; F7 s6 X2 G# _+ x& o
end; |
|