|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。" I' b8 p6 p# i: s
is
( x) g! }: ]; `8 c8 ?' y9 [. H a,b:integer;% `# b$ p$ n* ]$ y L$ b1 `' k
do- _, W- N+ Y3 ?4 G9 o
if store.cont.name="part1" then* @; e# F; H; m6 s) V) O9 x
for a:=1 to 4 loop
! T! f$ n+ i# d% h3 @3 G2 d9 d J2 l* W) W store.cont.move;
) }, d1 }2 ?4 C$ v0 \ next;8 w6 p8 s) c& y
elseif store.cont.name="part2" then/ }* l( c+ h, e+ v' j
for b:=1to 3 loop
( q) T5 H' x+ l( I7 F, h4 F' v store.cont.move;
8 m7 Z# ~# v, j' |" o. ~+ s next;
" g8 k1 G8 i9 {+ I elseif store.cont.name="part3" then3 K5 s) d! m$ J! n! V
store.cont.move;
$ M5 u G' }3 C: U5 n% S elseif store.cont.name="part4" then
/ t0 @* l! p! u store.cont.move;
8 ^9 R0 [! Y- D5 s( f/ ? end;( Q4 L( h J& V( g* F6 ]! y
end; |
|