|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。* G( { T- j9 |3 I6 `1 R
is
. @7 R+ g z4 g; Y/ _: q( w a,b:integer;( z3 z* O% W. X- Z( A% y' Q
do
- h6 z( K" ]# ?: }8 O" p6 ] if store.cont.name="part1" then
* G2 v0 l* |5 D; k5 w for a:=1 to 4 loop
' }$ [& q% J3 H; @: r; A store.cont.move;
3 M- L9 r* R/ U: W" b next;
0 q7 o# d1 |# d6 P' D elseif store.cont.name="part2" then
" r, _. ?# z9 v' U for b:=1to 3 loop. x$ _ Z& Z8 w
store.cont.move;
5 h2 Y) E6 g6 W! T- Q next;0 Z9 r0 _/ c/ j3 S7 ^
elseif store.cont.name="part3" then" s" ]2 X; j0 p9 [8 j
store.cont.move;0 p0 d r& A, I$ h
elseif store.cont.name="part4" then/ H# ~" u+ h- i4 J- r
store.cont.move;4 n2 D, P5 o! ^0 B$ [
end;2 | [+ ]8 {* G
end; |
|