|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
6 u4 n" u4 H0 w1 y Wis
/ a* S- r, H4 z6 h! U6 r+ c2 u a,b:integer;0 @, p6 F/ U0 w- O7 \! o
do" ~; p% h0 E; h5 @! n
if store.cont.name="part1" then: j* g4 i- h$ L8 _ o
for a:=1 to 4 loop J2 [: Q8 c0 [" |! E- P% c6 @
store.cont.move;
. c1 k! U( x5 O; u next;
" d; ?1 C* D. V# Q% r elseif store.cont.name="part2" then, w, \8 B6 M1 ?% Y6 n
for b:=1to 3 loop1 ~7 c p7 i8 Y
store.cont.move;# a* N! C& `2 v; k
next;2 P0 S! u5 x/ F
elseif store.cont.name="part3" then+ r5 E Y& T0 l) S4 \' e7 N
store.cont.move;; i! v& N! o# ]5 b% H
elseif store.cont.name="part4" then% }+ t w7 t& t0 s2 `) m
store.cont.move;
6 s0 ~( J7 H* b+ O+ t3 j' S: y end;# Q8 k6 A5 O) f/ u
end; |
|