|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
* c3 t4 y8 G- O; Yis ( H' D" `" T0 j g x
a,b:integer;
7 e8 f) g( ~9 j: K+ p- k- edo
' r" l3 G! N3 F5 V if store.cont.name="part1" then
?; n. G' M& { for a:=1 to 4 loop- B1 K1 r: E1 }' B
store.cont.move;
1 m' e0 K, A- E2 M& G7 s$ R8 u next;
Z$ ]7 |- a' K+ p+ ^6 Q* | elseif store.cont.name="part2" then. N* }( r) H0 e" o3 f' W
for b:=1to 3 loop) o- d" O4 V R- E/ w! ]) ]+ [( c
store.cont.move;( j& j/ e! h4 N0 K' }$ X
next;
, ~( M: c- Y S# s0 n" q, n/ j elseif store.cont.name="part3" then. N& Q* P: F3 k( `
store.cont.move;9 e, K( h& R$ D3 D
elseif store.cont.name="part4" then
. c: b; h& G$ h+ {/ ? store.cont.move;
- J$ R, g5 y: X5 W; N end;
! Q2 J; H8 M1 t2 P end; |
|