|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。3 h3 v- V& F U, ~: O5 s5 ~! p% h
is
$ R( k, l) f- t a,b:integer;
) t* s& s' L, [ v* w2 z( H- [6 n- Ido
& E8 ]2 ^0 G& R- r1 A if store.cont.name="part1" then
5 Q( u. U# d% P for a:=1 to 4 loop6 K$ Z9 x- s9 q- o% ?
store.cont.move;
* Q& l1 A9 c3 k6 y4 o% a next;
; D8 H1 `+ e( n* {/ s. g elseif store.cont.name="part2" then3 S) j8 c# M& g
for b:=1to 3 loop0 m: Y6 O& B0 |# a
store.cont.move;7 B# r# k; _9 E* H
next;
/ y$ q3 D8 Y2 t- d* Y- a1 L% r elseif store.cont.name="part3" then/ o& w4 z2 a7 Z6 P
store.cont.move;
q. w; V/ v, Q3 X+ M elseif store.cont.name="part4" then1 y9 ^' p7 l2 p- ], n2 B1 z
store.cont.move;# f+ x- ?0 w$ Z$ c
end;
+ X2 E) O- r2 L0 B: n4 J* v end; |
|