|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。4 O) Y e, f6 n/ X) P, T
is
; m7 a- X% Q- A3 E+ m a,b:integer;6 p- v3 M' R5 R
do: @! c# r- k E. x- u$ [
if store.cont.name="part1" then
C7 b, P. s+ y u# ^8 |1 ^6 b- [( n4 y for a:=1 to 4 loop
* K1 N7 V* g) }! ? store.cont.move;# }1 f8 L- k/ b. y9 r
next;
( E0 S: F: [& A, W# n6 W# S elseif store.cont.name="part2" then4 D# w+ b6 S9 f0 T/ X2 N% S F
for b:=1to 3 loop' n/ |( z G, t# r; @
store.cont.move;5 ~, S8 O( b; i3 h: Q& v
next;
4 H/ C$ b9 z# z. F5 E6 h8 X$ z# m# \ elseif store.cont.name="part3" then4 g0 B- g( z3 \1 L
store.cont.move;
6 M" b% l& R r& T elseif store.cont.name="part4" then7 f7 G* _# u, ]) V, {3 w" I) S
store.cont.move;( O+ ]7 | V6 g p$ o
end;
) A( [2 S9 N5 g6 L( U end; |
|