|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。7 c5 e4 p0 \, `1 d6 E
is
9 m: O1 U! ]4 b% ` a,b:integer;8 e j4 o$ l. ?3 P- Z
do5 S& ^1 z% `$ c R
if store.cont.name="part1" then
9 q7 M4 C6 n8 A k. M for a:=1 to 4 loop
7 M6 l2 D" D$ m, n store.cont.move;
3 n) H# Z, `+ z1 a& A- j( a! P next;
- S, a, Y) G6 h0 F) z% K( M9 \ elseif store.cont.name="part2" then
! q& K0 p, h3 F- o8 e. l$ P3 F! n1 { for b:=1to 3 loop2 c4 d2 B2 _8 r- z
store.cont.move;) O7 g+ |1 I7 g2 `& u9 n+ i! q) c
next;
7 V: |# ]4 J! T9 P9 p) p elseif store.cont.name="part3" then
7 s. h2 u$ ?0 W( M store.cont.move;
& y5 I2 t) q7 X2 E' |; y elseif store.cont.name="part4" then
# n p& a/ s5 w- R store.cont.move;
7 I% a5 w# v4 @8 k) `) g! r end;, K8 p8 J: Q/ E2 h- t. ~: }/ n1 ~
end; |
|