|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
$ A# b! p5 s# o* Y) K& i+ Ois . x/ l, {' V# B/ t9 S! b
a,b:integer;0 g7 R( e/ P: U2 _7 P6 D
do
! M, W2 M/ h1 }2 d6 t3 z4 L if store.cont.name="part1" then
# @) q# }5 i {2 K' V/ w( v for a:=1 to 4 loop( j! L/ _( [) H6 M$ m9 u
store.cont.move;( R; e" ~$ _4 \- A! [, u$ V
next;
* Z2 O( s9 |9 s: W7 m9 @/ [ elseif store.cont.name="part2" then; e1 U- U2 M% C' K+ T
for b:=1to 3 loop1 k" t! c# V- m7 r8 J) h; {
store.cont.move;
/ {; N' h1 P* n4 u8 k9 c next;
4 @6 }4 Q9 d2 r2 c6 ^$ e# K) d elseif store.cont.name="part3" then
7 @$ ?4 A2 ?5 F) }- g3 r' j* e store.cont.move;' b7 |' D/ ^. z! M# b- L. M
elseif store.cont.name="part4" then
8 j2 ]1 A$ C- O( k: v- u& j% { store.cont.move;9 N0 {% Z" c! p! ^6 L
end;) c% w4 P" |% y4 e- U
end; |
|