|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
! h1 [# A% |" ]0 r! gis ; x/ W) i7 N7 J2 M
a,b:integer;
- A4 @' k+ G' \* [) h: a0 {: _do7 V2 b8 `0 m7 ]! t/ ^* f& E
if store.cont.name="part1" then
- o% Y# f: W# n; Y- A for a:=1 to 4 loop$ r/ u6 [2 h8 L& P
store.cont.move;
0 K( P& F; v5 K9 L next;. k, U& M& J4 d2 l. `( k$ ^
elseif store.cont.name="part2" then) K: x+ g% I" @
for b:=1to 3 loop
" W# O2 t5 j1 y store.cont.move;
9 h6 j7 P5 z$ m* ]+ T9 V/ } next; ~9 t, x6 P7 \/ o) D$ I' A6 |
elseif store.cont.name="part3" then
) i# P/ @4 E* c$ \( C store.cont.move;( @ b4 U W6 \( A) N
elseif store.cont.name="part4" then
. j! ?( f; t1 F' u store.cont.move;3 F" }1 n! t+ w; D6 g. p
end;
4 j8 u! N [3 Y8 ?7 g end; |
|