|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。: i" o3 Z- Z i1 \1 K. |1 p
is 1 o: n$ s& N' X: o
a,b:integer;
9 ~4 G& D+ u7 A% M+ g3 q. {9 I& t1 jdo
) X% i& c& J4 k5 v: [/ H if store.cont.name="part1" then
" I% Q3 `; \/ g% L& o+ Z- Q for a:=1 to 4 loop* P. l* T7 H. {* ], g1 h! Y
store.cont.move;! H- b% {1 w" M
next; a$ V) ?/ K8 q) X
elseif store.cont.name="part2" then, F- O6 s) M1 G/ n" H4 P
for b:=1to 3 loop
/ O% j, X3 Q' w% x4 `8 p store.cont.move;
2 D* m; h c, I8 z- x5 d next;6 a3 ^5 N! O4 S+ i9 h' T
elseif store.cont.name="part3" then
' d+ {- B6 n0 ]2 d) G store.cont.move;
0 \: U7 G6 F9 C elseif store.cont.name="part4" then( O3 V6 g- b5 q% \) A4 m
store.cont.move;5 N) t- [9 h7 Y& Z' S
end;
1 U+ R, f* s% B end; |
|