|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。' A2 A6 `# ^( f" Q1 d) ~
is
$ y6 Z1 m! J5 O ] f a,b:integer;/ \8 C0 U6 p8 V( L( }1 f- R& ?
do) ~* c" U8 w0 ^! k( `1 `
if store.cont.name="part1" then
' |/ ~' [; A# }, ]! S for a:=1 to 4 loop" B2 J6 F- O: x8 H2 c
store.cont.move;
: N4 L6 J& n/ E+ I8 ^" H( x# u6 f) S next;) c, z: ^8 a) Q2 Z6 `
elseif store.cont.name="part2" then0 T3 ?2 k* p- N% T( Q6 c9 ~& {
for b:=1to 3 loop7 C) W- j& V$ D0 ]
store.cont.move; P/ J8 E4 _) s4 @0 G$ b
next;1 S0 w# t3 m4 w3 n
elseif store.cont.name="part3" then' s! e; C! h0 R; K1 B1 M
store.cont.move;8 m& X9 u7 H, F# b0 F
elseif store.cont.name="part4" then
' x6 D p/ W. ]: u- a store.cont.move;
$ h& d: D7 q: V% P6 `& J end;
7 ]! N8 N6 Z- {+ Q* a# ]. B end; |
|