|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
5 l, N2 K+ G T( `is $ R+ C3 `1 ] }$ A- e2 l9 m" X
a,b:integer;
+ S- Q& c3 w; _2 {- g. ^# V7 P" Ldo
, S) H" q" t: W1 @5 R% X: {5 m if store.cont.name="part1" then" r6 \' x) ^3 |# Q, M
for a:=1 to 4 loop" T! X: W# K* d
store.cont.move;) W, H9 C" E7 C( |7 z2 o
next;
1 G! \, I. [) n$ U9 D- v0 B& Y elseif store.cont.name="part2" then1 B0 P" i* `% b. J9 s( \1 b
for b:=1to 3 loop$ B$ o( }/ j; g9 z7 O0 w6 w [
store.cont.move;
$ y4 P5 n, b+ v n7 G4 } next;1 ]( ^7 E) A, Q4 n9 X9 S: L9 L
elseif store.cont.name="part3" then/ V& }$ c8 P; L
store.cont.move;, Z% P) A7 t+ h2 j9 E* W4 f! a5 S
elseif store.cont.name="part4" then
( X! @: v: w- j( k$ ^4 q store.cont.move;+ [2 w. ~/ p6 P3 e3 ~% u4 [" d
end;/ g2 R( }! Y; R) T6 C* C
end; |
|