|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。# E# g- e$ S3 s5 V1 ?
is
- |- Z1 V. B l) R a,b:integer;
8 ?2 d7 z1 ]% G8 I3 b( x o: Vdo. B9 q Q; R& R; W9 z* Y. h
if store.cont.name="part1" then
7 W4 X' m0 b% G3 L, x Z* i( Q for a:=1 to 4 loop) m) U2 {2 m" A1 F; f
store.cont.move;
# F. E) g/ w5 h8 P8 [) p1 } A next;+ w/ J' |, s& U$ W8 r2 p9 K, e, v9 Y
elseif store.cont.name="part2" then
" n/ Z* f, o) {; L* c0 v2 D for b:=1to 3 loop/ \2 |8 D0 `$ z' f% v X+ }# j
store.cont.move;' t& o, z% }( O& U: w7 d% v1 \
next;
, V3 ~- ] f% m: l; z elseif store.cont.name="part3" then0 C$ E6 x1 p- E! z. `8 b! U# Y9 N
store.cont.move;
0 J. w8 o5 U- i; l" [6 D$ V elseif store.cont.name="part4" then
; Q* _ O: D+ w2 S5 K2 a store.cont.move;7 c/ S* x6 b1 G
end;$ Z* V/ s2 \7 C
end; |
|