|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。, W7 Z! a4 _7 g& T8 M6 L
is
. [% p# P( [: D, d: A D a,b:integer;
* t' H5 _5 }6 Y" H* s5 @, V; Odo6 p3 j5 _4 K( {5 u
if store.cont.name="part1" then
/ N$ ~! _+ r% ~. o: x for a:=1 to 4 loop
, `" B2 ~1 `* V store.cont.move;
' C! Z+ p' @ L2 f1 l. j7 ] next;
- D0 \0 d; K: {$ W elseif store.cont.name="part2" then
* g+ U& p2 k5 }3 \& p9 T for b:=1to 3 loop: Q2 J3 J4 s: o) D
store.cont.move;; G' }( j8 K' e& b# }% z
next;
# s4 @ J8 A. q/ _# @" _6 F/ a elseif store.cont.name="part3" then
6 o) E" y3 N/ ?2 F; ` Y store.cont.move;
, r: L7 x) g& K elseif store.cont.name="part4" then9 K+ G0 x7 `) X6 L6 b
store.cont.move;
* K& M" u) k: r% z% W end;- E! D+ o( J: _ s7 K6 ?. o
end; |
|