|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。# e6 @' F% K9 x
is . k3 u9 s7 ~( S, x( t: D0 B! w
a,b:integer;
8 \% C/ ~2 \7 f0 Xdo4 t9 {# ?- S1 U* I1 ^: I; `6 M
if store.cont.name="part1" then
: V E- H2 f3 z3 {3 |; D for a:=1 to 4 loop
9 c8 |9 l9 N) @& | E$ Q store.cont.move;
+ x/ J' ~5 k( R7 N' j. g next;
- \# _/ m J0 w+ a- G2 Y& g elseif store.cont.name="part2" then9 ?4 Z! o9 b4 q* R
for b:=1to 3 loop
. c( `$ H6 U' O store.cont.move;2 u3 p: {3 v, F- b6 _( a& u: I( |
next;) ]5 o/ N% h% j {
elseif store.cont.name="part3" then
; `" z$ w' O" E4 d store.cont.move;7 U+ q( E7 c) K" F* A
elseif store.cont.name="part4" then
- t9 o* @; _) G F+ V store.cont.move;
$ {- w, l' d& ?& x3 k( C3 u end;* d- k+ o ~) u7 y3 U
end; |
|