|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
! a4 [' _7 K4 t1 k- Dis 4 ]) G, ~, L" s+ e5 V w
a,b:integer;
G1 S0 Z3 g5 h) Rdo
2 q+ b: P6 b. m# ?" Q if store.cont.name="part1" then7 x7 e( Z$ K# s0 g+ J: q8 ?( R% F5 p5 w
for a:=1 to 4 loop
$ q9 E" b2 P- k! G4 X store.cont.move;
7 |( Y0 M% q: ~& d1 ~3 x5 ]2 } next;- g$ C* s4 s8 v
elseif store.cont.name="part2" then
3 k" k/ `0 D! s1 \& v- x; }8 I- K for b:=1to 3 loop
! ?" `: Y' w4 U9 }9 |1 B store.cont.move;8 V$ M1 m8 I" A" G3 B; j' s0 i+ Y4 E
next;" x! N+ t. V1 f8 _- x+ ?
elseif store.cont.name="part3" then! V' m) R) |! O/ \8 ~
store.cont.move;
" s+ k1 I' J0 G; y elseif store.cont.name="part4" then
" L+ F. h6 L+ ?7 Y P/ H3 ?: z$ K store.cont.move;
9 p* F' l3 C, A f4 d6 T) d end;7 t Y- V, {& Q1 H( x- y
end; |
|