|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
3 x' i; l( E2 @. n! H: o" G/ Uis
2 n0 z* u* K5 T j& d) z a,b:integer;
0 i P# {# g1 S0 J! q2 p# ^do
( w7 i, _% P7 l2 D; Y4 k Z if store.cont.name="part1" then* i( \$ N* i2 O' a* ]- h
for a:=1 to 4 loop, j. c7 Y% Q7 M- H- |0 H" ]
store.cont.move;
2 n) U& B/ e: I8 s; S next;
+ Q& M7 z$ K2 P9 ~4 c2 Z/ T" s4 O elseif store.cont.name="part2" then
. ~/ t8 ?$ w3 m$ s for b:=1to 3 loop
: ~$ O/ e0 ^4 n; o6 m$ b2 P store.cont.move;
; ~8 ]' w" n: x: i& L: h next;
. |& |8 o" {& E, h: X elseif store.cont.name="part3" then
5 m1 E& Y$ w- B store.cont.move;
4 f I; _; ]. `2 w elseif store.cont.name="part4" then
, |5 c! K2 h+ Q) b. E- ?9 c+ k store.cont.move;
w+ b; Q3 {; z end;' T @! b# @' j8 ~$ ~7 H' z/ Z
end; |
|