|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。* }: n8 M6 ?! V$ S% n% D
is ! N1 v0 O7 n+ i9 [3 x5 B
a,b:integer;' f9 b9 j/ b* h! y: y" j- h( o
do
. p" I1 I3 e5 x' N+ v+ S if store.cont.name="part1" then9 J9 n1 y# e0 Y5 I3 e- {. F
for a:=1 to 4 loop l# d4 r' k! a9 h. H
store.cont.move;' y q; ^# z. r1 r' k4 b! U
next;9 t. ~4 {' v; e, U9 f) E* O
elseif store.cont.name="part2" then A2 w& _* c8 ^) J
for b:=1to 3 loop
8 w0 k+ i! N+ K) f5 x store.cont.move;2 f2 _1 D" b9 L- e7 X2 v- _" Z4 d
next;
% x+ v% Q* u( }% d- b9 i3 Y3 N elseif store.cont.name="part3" then1 ?, e* u0 {7 [, h
store.cont.move;
! \. @5 Z s% \1 O$ i: g& [! t elseif store.cont.name="part4" then5 J$ \9 l6 v; B8 r0 D: A
store.cont.move;7 {5 S }- x1 I0 w) O9 M
end;9 `1 m4 C4 U! z- K! E
end; |
|