|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
0 A5 N3 `4 \ J# f+ @0 K/ d4 W2 ]is . v& y6 k: n% F( a* w
a,b:integer;$ l& ^9 j' G! Q: S
do
0 z7 c5 L/ u6 Q$ E- p1 h if store.cont.name="part1" then1 _7 y; v( {3 Y" U5 V
for a:=1 to 4 loop* [& t- ?7 T( t8 e( @) ~* P
store.cont.move;$ Z) B$ @0 L) _ y
next;
6 r6 U* k% O( g& j3 ] elseif store.cont.name="part2" then4 j/ k n4 Q2 y0 J9 O# x: b
for b:=1to 3 loop
/ \; Y3 a u$ E store.cont.move;0 X8 c! o; G, M& b3 P9 F
next;2 m) }4 k3 x \9 h7 x J* q7 ?
elseif store.cont.name="part3" then i1 V/ o$ B) {
store.cont.move;
& S5 B( ?0 V1 e O( }, K elseif store.cont.name="part4" then! t+ |0 x. l4 y" n+ k
store.cont.move;
4 \ j! u, K# C: S! I4 L8 k b end;
; i) G6 w. `: E end; |
|