|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。" Z1 n3 v w5 s( i4 E4 e
is
8 V3 M) p: E: a( a8 s# h. j4 d) s a,b:integer;- w6 o* T5 R* L! Y" ~5 o+ q
do
, c9 U+ K7 F9 {- p# \! n- y( b4 s if store.cont.name="part1" then
" j2 n$ R6 |0 U" l0 R for a:=1 to 4 loop) e3 W P3 v, k
store.cont.move;, y& Y' U8 J6 y T7 j
next;' v E8 i$ i7 o; m
elseif store.cont.name="part2" then2 F) m7 n: K/ {0 g/ T+ U
for b:=1to 3 loop
' `7 s% I# x9 V& O store.cont.move;
: B0 z5 E/ X+ I3 ?: B5 o9 @0 u% D8 r+ i next;
3 a( K0 s; m, k6 |# Z elseif store.cont.name="part3" then5 m! K0 K. A0 [- ]
store.cont.move;
( ^/ J: q: Q8 N) @+ r; r* L$ ^ elseif store.cont.name="part4" then" r# Q: B h* F7 J6 m
store.cont.move;
) i; f& q' N$ `( o; p end;
# Z1 h" Y3 B6 e9 n: i) { end; |
|