|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
$ C8 D7 A/ w% K) h: ^# pis 6 [! x }: s) P/ Q$ f* A# n$ q
a,b:integer;0 d! C# _+ x, ]% T6 F
do
4 V1 m: v6 W4 ?( K if store.cont.name="part1" then
- y( i) B [) A& Y4 P for a:=1 to 4 loop
* u( O; g# C! U& m store.cont.move;5 g* t( w, v. f: ~% z
next;
1 H3 r2 C( w5 ?, G) s2 X elseif store.cont.name="part2" then9 {. _; p1 ~1 o* f* z2 U. M% k
for b:=1to 3 loop
, h; \! W8 O3 ~% o- l0 x store.cont.move;& d: r% D- y* M3 N2 V8 w# W& G
next;; D1 y; e3 U. j1 k. c- @
elseif store.cont.name="part3" then
2 _* a* ^/ \3 ?/ D" F" I) } store.cont.move;
% V! B: ~ B* G5 Z: {% Z elseif store.cont.name="part4" then2 w M6 w) V6 D$ o, i( f1 M4 }0 l
store.cont.move;
5 a) q' u. X) m6 M+ ?: G; Y end;# h. i7 y: [. Z; E
end; |
|