|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
1 N: F9 R# ]0 }% e ~; Y3 }7 xis
* g- g& Y1 [- v1 t$ X$ f- v' J2 e a,b:integer;
' h5 @3 b2 D% h' E# L8 Tdo3 d( y4 u6 [+ O G: A& a' j8 C
if store.cont.name="part1" then
8 d6 D P5 m( |4 b: M+ S for a:=1 to 4 loop
8 f. x6 E w2 D5 y) b! f3 c, h store.cont.move;( H4 `' R q. l) ?
next;5 i, I8 x `7 q1 M. l
elseif store.cont.name="part2" then
' L+ U R, b& ~6 e, d for b:=1to 3 loop. s1 j* q, Q+ Y. v3 k S) F
store.cont.move;
$ P" ~8 o, b+ [/ A* X0 }6 r next;
/ u# _0 W" I" g% U% L: ~% O. i elseif store.cont.name="part3" then
# V5 D; m0 F+ v3 K$ b4 f' ?1 a8 H5 k store.cont.move;
+ I% x( M- V' Y3 H. R elseif store.cont.name="part4" then7 u* l( b6 B* }2 Q
store.cont.move;
1 M o1 R) u/ a( w( B) R end;5 j# C# X. v- ]1 K
end; |
|