|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。9 S0 _* v3 A( D$ w
is
& W% [( f/ Y; C$ H( ]% Z a,b:integer;
1 ]( r9 E7 o& f$ T$ \do
4 k- Y' |2 l& U6 l& j/ s+ X: z" \ if store.cont.name="part1" then1 N5 _/ P0 b1 S5 o) e; q3 D$ A
for a:=1 to 4 loop% x8 ~5 `' W( J
store.cont.move;" g5 X7 g- `* Z0 z; q
next;
& Q3 K" X! Q. z( I+ o: u elseif store.cont.name="part2" then
( O4 h( v% ~$ x- L+ N" J/ _ for b:=1to 3 loop. ]' y0 T( p( b3 a3 C, ^
store.cont.move;
& K7 ?7 F0 p4 N' T' Q4 y next;1 w1 B& e6 y: Z, h0 O/ @
elseif store.cont.name="part3" then
: y2 m3 b- y; I! Z store.cont.move;
% W+ a8 o5 k2 d9 e" y1 [/ S elseif store.cont.name="part4" then
7 T1 u# A; p j$ ] T store.cont.move;) u- P/ i; M0 p$ G" f
end;
+ }' g8 M4 C+ _' f3 p- U end; |
|