|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
' g) q# i7 ]% g; i7 d( qis 8 C# ?1 i7 C* w" x/ A
a,b:integer;% C0 k- E7 ^. i" P; R3 l
do1 { G3 t* i6 S. C: h& c) o
if store.cont.name="part1" then1 w3 K1 n6 T" L
for a:=1 to 4 loop7 Z# \6 b3 a& P& E( H! v
store.cont.move;; Q9 q! j# p, @6 `- ~$ `/ L, a
next;' n `" H& |+ s! c3 t9 p6 H
elseif store.cont.name="part2" then1 E. g1 y; c1 s
for b:=1to 3 loop f0 |( E# a6 m {: c
store.cont.move;4 f, m) a6 e+ @, v
next;
1 ~6 ?- @) R& G0 V elseif store.cont.name="part3" then0 n/ A3 _0 u6 {; L
store.cont.move;
; ?2 @8 r2 p4 R; V! D: t" M, i& f elseif store.cont.name="part4" then
8 G$ b/ Y& {0 o, s" N! X* ^ store.cont.move;
) `8 w1 `, w$ G. w j4 Y5 V end;
/ w8 w3 D7 R+ Q. n8 R end; |
|