|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
* D* U3 A: D+ Y$ `' S# o2 Tis . T4 f, W1 u( W' Y; U5 U
a,b:integer;
1 R+ F! `0 n8 E! |/ B* t) pdo) Y- Q8 x: H6 j$ Z3 x
if store.cont.name="part1" then. u0 B8 I" B, @8 X. ~: C1 o7 ?
for a:=1 to 4 loop6 b( G6 a6 M8 {1 O1 S
store.cont.move;; M0 i3 f- b" E1 k
next;( Y3 a6 T6 B i5 V" i$ w1 r; T
elseif store.cont.name="part2" then5 [$ L; ^( N7 w, ]8 k
for b:=1to 3 loop y4 I1 P1 g9 y
store.cont.move;. e- u2 [, ~& \5 i0 P6 {
next;
, a. E- H1 Q$ ?" P( V+ v! \ elseif store.cont.name="part3" then
3 J0 s7 e$ r. U. a6 V- c store.cont.move;. e# H: M' p4 Y; d7 w; _
elseif store.cont.name="part4" then
5 Y- b8 Z1 R, Y store.cont.move;) l) |, ?. P* h v/ y/ O) Z# c# t# u
end;
% u5 O) h+ s% ?- J0 H6 N end; |
|