|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。. ~# x6 A+ `- I0 }
is
- a- @; R" n; @% a a,b:integer;
, h' _8 n6 m* Q- t. q- Rdo- i: m5 e8 n$ p _! a: z
if store.cont.name="part1" then
3 U3 _; x" E2 r for a:=1 to 4 loop0 T3 b! V( ^6 E& n! z8 I
store.cont.move;% e1 ~. U: c. d/ w* j4 }
next;
6 H) t! V1 P+ y6 g# R elseif store.cont.name="part2" then2 h2 C. F' h$ e; \ p& i% ?7 U# `
for b:=1to 3 loop
1 y* A# K3 Q# }8 g store.cont.move;
- `( M; ?, z9 h) K, \; V next;
2 ?5 \! ]! \% {5 y elseif store.cont.name="part3" then
; Q) S8 V- x5 T$ ^* Q5 a! x4 m store.cont.move;0 ]9 L2 R7 u0 n( P* l
elseif store.cont.name="part4" then
6 m& P0 r- B3 V1 r% v* Z store.cont.move;
, S, z8 L, G1 G! z end;
# [: |7 f" U q8 [- ?% j end; |
|