|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
6 Y; }6 k7 e+ a4 d! ]is 9 z6 Q9 G8 y; X5 @
a,b:integer;
, b& n! f2 B# N/ U; Q/ X1 Z. }do, |8 {+ r# `. W4 x7 j
if store.cont.name="part1" then
5 f0 Q E& v; S3 ]! [4 Z% m for a:=1 to 4 loop" R1 _ c* O6 Z2 x- a
store.cont.move;" }2 F5 i, p7 L, W
next; y* z( A( t0 E# \, \9 [4 K$ B
elseif store.cont.name="part2" then
1 S; ^' v2 f. P& v for b:=1to 3 loop
" Z+ J8 k1 s/ C( P2 n store.cont.move;
% V% k" M8 u% r next;2 U- ^, P5 Z) }' t8 k% ]1 h
elseif store.cont.name="part3" then: {) R; z: X) {& y
store.cont.move;
8 _ A; V7 g3 ?' G$ U elseif store.cont.name="part4" then
3 W4 m% D i; e* O8 E; ` store.cont.move;: ^9 R! J8 V! R
end;
) c3 C) \$ V2 @* D6 z0 A1 K% y end; |
|