|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
7 K# I/ o7 D3 }2 Tis
0 A- s6 Y2 n. H7 T6 U a,b:integer;- W3 D8 _' h5 C: w) k2 C O0 z( X
do% h- i% q" w; S* S
if store.cont.name="part1" then
. t( x( y3 }0 ~ for a:=1 to 4 loop4 ?, c% `" Z5 K# v! Y. ~
store.cont.move; M4 }+ y+ Q! I+ Q0 d6 ]
next;- ]* ?! t& V" z9 C3 u( R! W- q1 s
elseif store.cont.name="part2" then
1 X8 N& b2 s1 X$ j9 D7 Q for b:=1to 3 loop& i8 w9 u1 Q; L* |1 Y# L$ m6 S4 V. }
store.cont.move;
: R v! n6 L- B next;
0 _0 z! G' y2 ^ elseif store.cont.name="part3" then
/ B- f2 X4 j5 T2 @. v store.cont.move;
2 {6 P4 ~0 K- ]6 r: ] elseif store.cont.name="part4" then7 ~9 i" i6 J4 }3 J
store.cont.move;6 u9 m: r: J+ X0 H" Q
end;) t& p& |9 U% O! s! L
end; |
|