|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。, L9 | {) | I8 s, q, ~) y; E$ T
is 4 L0 q) h; T6 G# w5 d2 v
a,b:integer;# V. A u7 e8 Z$ w1 e+ Q
do
. S$ B9 \, \: M4 i* n! ? if store.cont.name="part1" then4 U3 i) v: K) e2 p/ `' t
for a:=1 to 4 loop9 e' p5 n( L+ S3 Y
store.cont.move;1 u: H; o- y6 c# ^- S
next;( \2 F& p7 C9 j2 ], K2 [1 S$ a
elseif store.cont.name="part2" then
( S- I/ i _0 P8 _% j# f( A for b:=1to 3 loop2 j+ t* V0 @+ F& S* c& R
store.cont.move;- J! ~+ s- i: r0 d
next;1 q" d2 O% I# S# H: T3 k& @% K
elseif store.cont.name="part3" then
3 Y0 x0 l% c, V4 H% D store.cont.move;' q, g7 _% \. A* T! f/ H) ~
elseif store.cont.name="part4" then8 `9 D; Z( O- G1 z& ^ Q
store.cont.move;% U) G C6 s" t7 x1 l; @) y
end;$ e! o8 T4 @' O) h0 G1 C( d! P
end; |
|