|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
9 z$ q/ g7 [8 O; Uis
1 d" ^+ t2 `5 S7 L a,b:integer;
# ^7 ]+ B k% M, [do
: v* ~* _& T: C' {0 H, f! L8 Z if store.cont.name="part1" then9 y6 ^: t8 K Z$ C; Q, F: ]$ f
for a:=1 to 4 loop
" f8 l1 m& C1 W1 E store.cont.move;8 c7 Y; R3 Z* D
next;
. n8 D1 T" W3 ~% G0 @ elseif store.cont.name="part2" then
1 Q& C" ~) k! |& ^) A0 U for b:=1to 3 loop
6 {, d' L) n7 X4 G8 e store.cont.move;0 m6 v% \+ k" V* M9 k& c. u
next;
# b* `6 Q8 I* |5 ?1 p elseif store.cont.name="part3" then/ e# b* |' Z/ u7 W, q: Z1 ]
store.cont.move;
/ g, `" z% Q- U- T! p v+ o+ j( x4 _ elseif store.cont.name="part4" then
- N, c9 ~2 G6 b store.cont.move;: P9 b+ }1 x4 _5 e* Q
end;
$ w! X3 {* m& `7 r$ ~/ w end; |
|