|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
, B' \7 R, i7 y" J% j( i8 g2 ois / q7 G3 s* o* H6 }$ h
a,b:integer;
' o i3 v6 \, g6 g& qdo
8 \; C1 Q$ C5 t& h9 X( V if store.cont.name="part1" then
1 d* v; W+ W2 o- K/ Z# h) q, D' W: t) I) t for a:=1 to 4 loop
- p5 u) L k: l store.cont.move;+ W$ H Z A7 Y. n& |0 X
next;
* J v: e R( t% U$ q( k& R elseif store.cont.name="part2" then
# o' \9 W8 X6 j# N for b:=1to 3 loop
% W/ t% W; }- [ store.cont.move;* P, S2 Y' K; n4 H% j/ s
next;
3 t z* N/ X4 C ? elseif store.cont.name="part3" then
; n) v1 l w5 B8 b5 O7 B5 I+ o store.cont.move;
) D2 f4 w5 q/ e elseif store.cont.name="part4" then' `' p; b' V# t/ o$ v) Z
store.cont.move;# N/ ~. I2 I, o
end;7 j$ i6 }! M7 \' e% p$ _
end; |
|