|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。7 a& q* F+ C+ }# Q
is
% S5 S1 T: h$ k( Z$ D3 e) ? a,b:integer;
- |: S: m }& \4 W' \- }& Wdo$ O+ ]. Z ~5 @" m2 r$ u
if store.cont.name="part1" then2 U% _' X- `# U* [1 W
for a:=1 to 4 loop
2 O0 P5 W4 W' a9 ~& q) O store.cont.move;1 S: }) Y& Y6 A3 }" a7 F/ A
next;1 a* x! L2 [9 f
elseif store.cont.name="part2" then
* [+ A$ W0 F9 d1 O: ^ for b:=1to 3 loop4 a. q9 C% w( {' o; N
store.cont.move;
) U) j) D( F/ k' w8 Y next;
6 R/ R) L" a2 }: b p elseif store.cont.name="part3" then
4 E. i' V. h0 n4 C6 n4 P store.cont.move;3 o1 r' I2 v, p
elseif store.cont.name="part4" then
& e; k7 X5 x4 U4 Z* l, y9 C store.cont.move;# p9 A+ j4 O5 P1 D7 ]
end;
3 n$ Z1 _* c5 | end; |
|