|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。 ~, @. h' q, Z1 i# A' d6 @
is
( A# w+ |9 [6 G5 n0 d, @ a,b:integer;1 z+ Z5 ~0 ]9 l$ K7 K L# b
do, P5 r% Y" ?% P8 d
if store.cont.name="part1" then8 \ n7 j1 U/ D0 L- o% r
for a:=1 to 4 loop2 M, {" _( d% V9 r
store.cont.move;1 U# r5 m I* X8 ]: M+ h
next;
- y) e! w8 O/ b8 v+ s- |( X elseif store.cont.name="part2" then
# E8 C- Y# i, ^6 v: p/ V/ J( ^ E for b:=1to 3 loop
& ]; ^1 K1 S6 t& [2 U& z" @/ w0 q store.cont.move;4 h5 K* a3 Q: c' m6 O2 R- p% Z
next;1 i4 M5 Q/ M3 k# X
elseif store.cont.name="part3" then
$ A8 u" t( y/ p* l, C% E store.cont.move;$ ^, M0 X% p! c& K. _
elseif store.cont.name="part4" then3 p! ?0 X% o O, H
store.cont.move;( m+ O+ ~9 A9 S5 }
end;& o/ E# i( P: C6 A2 p
end; |
|