|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。) X8 D1 ^0 Z+ E8 Z) G% q/ L- s
is
1 O8 }& z# P4 h- ? a,b:integer;! s c% S; H- N- a
do
# S4 I3 e6 o4 c* z" y+ ?$ O" } if store.cont.name="part1" then0 I/ p- o6 c/ P+ p4 O& f
for a:=1 to 4 loop3 T/ R# P$ w0 ~+ G- y
store.cont.move;
( y7 c( N1 _/ t# d" H V next;
+ \6 x* `9 u. _4 U- Q2 ]; ? elseif store.cont.name="part2" then
. B! `3 ]8 G' E- v0 k. G c for b:=1to 3 loop
; O- P8 V( e6 u! L store.cont.move;! ?- L6 O* ?. X' P6 w9 Y, X
next;
- a/ }/ ~1 ?' X) c0 k" X, P& |) @ elseif store.cont.name="part3" then
& y+ K& m& J7 a store.cont.move;+ N* Q7 G3 v3 B
elseif store.cont.name="part4" then
/ O& u: j, ]3 G! @1 c, }3 s store.cont.move;
g W* V8 k' J. y+ J7 Z end;* I# q3 O' [% z2 V/ c6 P
end; |
|