|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
& ~! i+ B& l! j/ p" t0 J( V0 r* ais
1 z9 H/ I. t' ^1 T, H a,b:integer;* \, j1 d G- {* |
do0 s' D" [; o3 x% P2 l/ N5 d
if store.cont.name="part1" then
: ?9 {5 L$ j& s) S e7 f for a:=1 to 4 loop/ `+ }. F( [0 H6 D4 Y4 A
store.cont.move;
5 |& X+ _; m: i% t. b& u* B8 z7 t9 a next;
/ h9 g( l+ h" z4 z/ K elseif store.cont.name="part2" then- |6 X) g8 {2 Y+ c6 M- @
for b:=1to 3 loop
$ I7 _2 g3 o1 }6 ~ store.cont.move;
% f2 N/ ]/ ^9 Q, x1 ?; ` next;
" g0 ~8 P' _. n. A' f$ V elseif store.cont.name="part3" then$ \" [. d7 H! C% u+ i
store.cont.move;
( M( s9 ]: F' u+ i& G1 s; b elseif store.cont.name="part4" then8 ^* J9 O6 F6 f4 H( k
store.cont.move;
# k9 m4 `& W: R4 B6 H& N9 R* X# [! T3 o end;$ O9 Z# [1 m- x9 ^6 Z7 y
end; |
|