|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。 S5 w# r" f7 O% \! y# R$ B7 d, L% V* V
is + m+ t. c, o2 Q5 P# {9 d
a,b:integer;
" I1 t0 G" D* |/ R9 Jdo
5 [) Y! _0 w7 W if store.cont.name="part1" then
' @7 ?% B/ x" Q& O for a:=1 to 4 loop. B3 {" M6 f- L1 y: @
store.cont.move;* g- p8 V! [7 o3 m
next;
# \4 H6 ?9 G, U4 b) I/ V elseif store.cont.name="part2" then3 z I/ w: E! U; Y2 }; ` \ @( `
for b:=1to 3 loop
~# [6 \7 g- E% C store.cont.move;! \# f2 a# b. ]- Y
next;* m) R- d! D* L
elseif store.cont.name="part3" then0 J1 x! O2 l+ I
store.cont.move;
9 ^% v% |; S/ ]5 {$ n" n. ~$ z7 P- y# x. y elseif store.cont.name="part4" then: T7 E0 H) o. P" E, c* z; Z
store.cont.move;
) o! G' u- @4 ]3 ?) o9 \8 K7 c end;2 q: o, T1 p' W# {5 i% S# W
end; |
|