|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
; `, }# Z8 i( J8 s5 Tis ; b) X" j7 b3 K$ x, c
a,b:integer;( a5 B0 Z+ R9 p( b$ S j6 S, ?
do) ~3 g9 ^* y6 b' n. Z3 P
if store.cont.name="part1" then
7 _4 _# x9 {# H s0 L4 M: E3 c for a:=1 to 4 loop3 K1 _( R- ]. V' R# L+ [& s
store.cont.move;
) _2 m! h* z* \. q5 ?7 L next;
7 N% u2 }7 o+ n+ n( t8 v/ X% ] elseif store.cont.name="part2" then
# S& i% a! ^% M0 t1 Z! p2 @$ d for b:=1to 3 loop
/ O5 e2 }& m2 t; t q store.cont.move;; L. B8 g9 _' d3 [& f1 k
next;# A! Y J! u0 ]' M' f- ?$ R5 J' f
elseif store.cont.name="part3" then; O7 B6 K* F z0 ~7 U* q2 I
store.cont.move;
/ R7 o8 s/ `- S/ I1 b1 R elseif store.cont.name="part4" then
6 ^2 |! f2 L" a0 s store.cont.move;
( m6 @# L6 q, r$ F end;: G$ Z5 v9 q% e3 l
end; |
|