|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
9 t# k& J9 R1 ]" {* p3 y7 J* Bis
5 O" O& U; e; K! D+ _ a,b:integer;
: A% D" R8 ^" |& x; N' z; V( odo
5 I' W+ u" b) p% P" a3 ?+ }! I3 m if store.cont.name="part1" then) H5 c; D( z% l
for a:=1 to 4 loop6 l+ k* @8 d$ T2 _
store.cont.move;
% j {6 g7 V9 y! H) T: w next;
; z- B% r: w. G( g% V" V" s4 U elseif store.cont.name="part2" then
/ B- l! Q8 K1 q. b for b:=1to 3 loop' V; `0 P+ ?$ A$ u; `% R0 J2 z
store.cont.move;
4 h, c! n5 l+ r5 g7 U2 s1 S next;
! D/ \. ^2 f3 g elseif store.cont.name="part3" then3 q" U4 V7 S' C2 [8 q5 N# L
store.cont.move;
: Y% _3 T" u5 U+ r( |2 k elseif store.cont.name="part4" then J# l1 w& M* x' ~/ w" b3 Y7 d$ F
store.cont.move;9 S2 ~8 b3 l0 t# Y3 u' l1 d
end;
# r/ z9 S; x1 _! { end; |
|