|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。( h" S( m/ c; Q+ {5 l+ f+ E
is
2 e( J/ P7 J+ g/ d& q a,b:integer;
# h O% m; T9 r4 a+ Q1 k7 I7 M; ]8 ]do
6 d7 h+ O: F+ n if store.cont.name="part1" then
0 v& C9 s4 l. A$ x0 i for a:=1 to 4 loop
; C' ]# r( v C- ]0 `, Y6 L4 s store.cont.move;1 _- [4 L/ Q2 E9 a7 m" c" }( @
next;
$ P. o" D% c0 w3 |/ }" ?9 i- w elseif store.cont.name="part2" then; o& _. |; A) a, {9 [
for b:=1to 3 loop0 Y( i( Z9 C" z% K
store.cont.move;6 H% w! q9 G' l' n; Q# V! N
next;
3 E% _: H, {2 |$ D elseif store.cont.name="part3" then. ]! q2 U6 w# K0 F
store.cont.move;2 A; z6 [9 G5 p
elseif store.cont.name="part4" then* p% L7 Z" M- {' i
store.cont.move;
0 s1 K$ h$ o/ E) ?* T7 @6 B0 n end;/ a% ^; R% ^6 \% Y( {. r, Z1 ?
end; |
|