|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。6 D9 U- f4 Q: S
is % a$ H2 q% u3 k
a,b:integer;) l7 U% _2 h) D
do2 j/ i$ t4 t- w
if store.cont.name="part1" then
4 ]" _. ]3 [/ O5 d for a:=1 to 4 loop
, A, m V2 W! w) e store.cont.move;
4 u) W4 J% _$ ~ next;
) y+ d8 ] Y* d& J' k elseif store.cont.name="part2" then* y0 U' @' b3 D: a! |- T$ ~
for b:=1to 3 loop
1 h/ C/ O e( D; k" }' x5 [( @ store.cont.move;
9 p8 v% V+ W- ~2 ` next;' c2 y: v+ D9 Q1 y6 N5 ?: P1 J3 c
elseif store.cont.name="part3" then. l4 o# h$ Y4 U- a$ h7 i$ t
store.cont.move;
, C; ?3 v9 J7 G2 M6 ?2 B elseif store.cont.name="part4" then
: n# ^/ R+ w W store.cont.move;
- i3 O" D$ E& ~6 q' C, m# a/ M end;' z! G. M; a' T+ ?$ ~$ E" z; y
end; |
|