|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
& ^; E6 D u6 \5 X m, n& V$ His
7 m5 n2 x& a& O/ m! w. e& y" j0 n; Y a,b:integer;
0 {- f( O2 _% a$ f0 f9 v% ydo/ ?8 G2 I4 A( F3 c' u. ^" F6 U0 z0 v' n
if store.cont.name="part1" then
2 n0 s( _2 V) W* p0 L) B/ b for a:=1 to 4 loop5 o& I2 N: [0 ^8 v
store.cont.move;
- f& k4 \/ l+ a% L7 d" _* \ next;4 p, M: { i: |* B# E
elseif store.cont.name="part2" then
! u0 T: N. ?* m7 V; h/ M for b:=1to 3 loop! V0 {+ ]2 V! y3 L+ y$ S r
store.cont.move;
5 h1 v* e* ?% @& J# d; n) } next;
& X1 w" Z" k+ g$ A* U g- v8 [ elseif store.cont.name="part3" then; t `7 {. B9 E1 i( \" u5 d
store.cont.move;2 W" D. r2 ]) K- e2 Z" T
elseif store.cont.name="part4" then
" e( G, \5 t3 C6 @6 E3 Y" w, ^ store.cont.move;3 X& c H, Q I7 _/ B0 O6 v8 C0 m2 S
end;- X+ B, g5 I) n) h6 k! p& S' `# b
end; |
|