|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
/ {; b; r* S0 _/ e- i) Jis ' t# ~: ~- V$ [% R, B$ Z
a,b:integer;
) ]/ [4 T1 s8 |- V% ~$ odo
+ U! t! v& p7 G4 P' J if store.cont.name="part1" then* z. h# o6 K, d2 }6 \
for a:=1 to 4 loop
: D- h& |! W2 M9 ]+ W" s+ l" w5 n4 e store.cont.move;
$ T# i4 \+ c; Z; g0 V- { next;" L2 t, b3 W, T4 D/ q
elseif store.cont.name="part2" then1 ~- ~2 V& |" m! G& r$ R& h
for b:=1to 3 loop, L! p L* Q8 b$ ?. u2 K9 x2 u% C
store.cont.move;" y) S4 @4 K- i& S+ a* y
next;+ g1 X9 C/ W5 a$ P. ]
elseif store.cont.name="part3" then3 w$ j- H- S* C. @( z v. ^; W
store.cont.move;
( w- S* N7 w$ A1 r1 M ] elseif store.cont.name="part4" then; Q/ b" r0 }7 G3 O& r
store.cont.move;$ w- z7 p% j- o! r
end;3 S7 \- L8 Y1 g+ L
end; |
|