|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
3 T$ h i# \- E) K3 s# His 7 l2 Y7 j2 ]/ ~! I; D
a,b:integer;
% g) H+ J- Z" @' O/ ~5 ]do
. Q' h* P( W s* w" Q: i if store.cont.name="part1" then
8 L: z% C2 N, I; y7 z9 ? for a:=1 to 4 loop5 C7 p% k/ }! `+ Q0 m% F
store.cont.move;
- C% b2 Q0 }. D3 o6 H9 d/ W next;5 P& m. Q; X E& j
elseif store.cont.name="part2" then
2 N! `1 F9 D; A/ E# _* r for b:=1to 3 loop
' J# e( H! F& k) s store.cont.move;( g. U) |% e1 h
next;: E, l2 K* O5 ~3 e
elseif store.cont.name="part3" then, h; y s3 Q( }3 R: C3 `# M% s
store.cont.move;
8 L! |# I8 d4 _; ]+ ?& {( ? elseif store.cont.name="part4" then3 I% Z2 R. ?8 q. I
store.cont.move;* t e! Q& N6 F% L- t
end;) ?8 p% z* n# j8 D
end; |
|