|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。6 i" `) E, P5 S
is
% c' W3 E. o& n* g" m& D a,b:integer;2 f# J( b0 m; c) X% Q( A8 r% w
do1 M6 n7 r1 L# |6 `0 K
if store.cont.name="part1" then
5 V) `( D& _3 h2 s! s. K$ T for a:=1 to 4 loop9 L1 s9 c: z) o( q7 h, f! o0 s' D/ B
store.cont.move;
; p8 a H) ^- u G# M0 t0 i* x; O next;6 q; Q3 i9 s% z9 m. J
elseif store.cont.name="part2" then' O4 y+ V' ]5 M6 Q+ E5 Q# Q0 b
for b:=1to 3 loop2 m/ y, o5 ?: g+ L; @
store.cont.move;6 C) g7 c) M4 m* a9 }, A
next;2 i y7 c3 A: H" r! c
elseif store.cont.name="part3" then' c9 J9 [% ~8 _" S- R
store.cont.move;, M6 {5 ~9 y8 F
elseif store.cont.name="part4" then
, v; m4 K+ s3 f: R, O1 y store.cont.move;& z w4 z" ]4 y9 y" o
end;0 [ v6 _* T. L8 ]
end; |
|