|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。3 _/ U" [2 |' u
is : J! k' ]9 U) c, _# _- Q$ r h
a,b:integer;
& w2 d5 c. h- Q5 ido
+ [0 x1 m" @% M% n( W' O if store.cont.name="part1" then4 j$ Y0 o& k) z. s
for a:=1 to 4 loop
6 Y/ G/ z4 }+ }" B/ g store.cont.move;
& k# Z7 h' d" P* B% I3 M" V3 B next;+ g' S' d' S5 K5 Y, J
elseif store.cont.name="part2" then, |5 I: m" M5 Z1 _) c) r
for b:=1to 3 loop4 `2 A1 U% M6 S& k( l
store.cont.move;
# d2 I6 a o' @ next;( B8 `0 i" t$ \3 ?
elseif store.cont.name="part3" then6 J. K5 D4 J& \) @! O& w( m
store.cont.move;
) o8 I' }3 ?1 [; a3 u4 X4 o5 O, ]- i elseif store.cont.name="part4" then
: R6 q" }4 ?2 l1 c store.cont.move;
1 Y) O% |5 X4 U- |8 ^ end;, Q+ k* j3 T: R$ o5 V6 x
end; |
|