|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。7 b: {' J! h/ [& w0 i
is 2 m2 g8 w) }7 H: K* h+ \
a,b:integer;
9 \8 C/ w" H0 F" l% A: zdo
" C/ e# x0 E, r if store.cont.name="part1" then! J$ N/ y5 P0 I' a5 r
for a:=1 to 4 loop) q/ r( S4 N2 Q- c" E E, L
store.cont.move;4 {& K7 U$ t+ e( H: X
next;
: G0 C: B- w" N2 E9 }& h& |/ ] elseif store.cont.name="part2" then9 O* l5 t7 z! Z& @7 M
for b:=1to 3 loop
9 y6 ?) g$ ]" N2 N7 V store.cont.move;+ C, x) {% c- z$ C
next;: b7 u( Y8 }- A; D; Q1 Q, @
elseif store.cont.name="part3" then: l4 i: P; I( m! v; s/ B1 B8 J
store.cont.move;
6 U/ X" p1 \$ J4 @2 H* \, i elseif store.cont.name="part4" then8 n* R$ J" M* q' J
store.cont.move;
7 k$ r5 `0 a- O5 @9 | end;
! c& [/ \5 a0 D# |8 l1 `1 o' N end; |
|