|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
% U* N d0 P$ J5 m" Sis % q- M# R, ~, @4 e% Y
a,b:integer;
; x4 K9 W$ @4 e3 i- r$ p, \do
6 G2 q1 A' d' \; y* b if store.cont.name="part1" then6 ? C" \4 a# o6 p. R) ~9 F
for a:=1 to 4 loop
6 R A/ c% w. G2 J1 k4 q store.cont.move;
# p$ d; @+ U8 s0 o0 l next;! H+ Y* A" r; E O2 k
elseif store.cont.name="part2" then' U9 t- h8 J$ _1 ] X% x# V' P
for b:=1to 3 loop7 t6 g1 q% v4 B6 M. t3 h
store.cont.move;: p0 x1 x# z7 _# H# W6 m) `
next;5 ~9 ~* [$ K, I8 |9 X
elseif store.cont.name="part3" then2 K3 V, Y' h# W; l0 L; h
store.cont.move;) I7 ^( c) P7 [2 a: i4 h2 {
elseif store.cont.name="part4" then% X l) i7 E( T
store.cont.move;
7 t. y3 @$ e% H end;
8 N; o2 X" ^2 p- K end; |
|