|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
& `6 p: N' |1 L P( e, f& E ais 4 E- o% t! p; }3 A/ l
a,b:integer;
3 t2 P+ g w& rdo% D4 C1 D. c; |# l" f$ n
if store.cont.name="part1" then; f% G9 K; z' y& V
for a:=1 to 4 loop
- ^4 @$ h [! z: C8 A store.cont.move;
, r& i) z7 u" y: \ next;
8 u/ @) \9 g+ U2 ?& R; h elseif store.cont.name="part2" then. Q1 h# |! y ~
for b:=1to 3 loop, a5 r( ?3 }4 F, _
store.cont.move;1 V9 s0 z1 s2 C; ~# s, `
next;6 [! b s, D+ r) b, z7 }
elseif store.cont.name="part3" then
" L+ R q% G- R3 z store.cont.move;" O2 g9 X9 S+ d
elseif store.cont.name="part4" then
. X" d2 x+ \9 S. S9 [9 G store.cont.move;
: O5 |9 d; ?4 S. w: a% p8 } end;
3 C" C+ E: A# {. T. P3 b end; |
|