|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。9 g/ h% |6 I8 o, B
is
$ ~5 w2 u0 C+ X a,b:integer;! x! B: y4 H2 ~4 M c
do) d* C L8 {5 n9 B }3 T4 Q
if store.cont.name="part1" then
( P% Y- b) j9 h/ X8 W for a:=1 to 4 loop
* G+ R/ i. j2 Q7 g; i Q store.cont.move;$ f3 i3 Q* t8 B" [4 J8 i
next; i$ e0 h w S
elseif store.cont.name="part2" then
* Y5 B# {! N9 h& S1 S4 o for b:=1to 3 loop
) Z$ m1 r5 M/ b0 O) j4 S# n n2 |( S store.cont.move;: O8 C8 M" s* T* }6 O
next;) H$ N8 r: E4 {5 R& W# J
elseif store.cont.name="part3" then w3 @) T% R* j3 Y" s
store.cont.move;
6 N' f! P& \& X- I( ?) c elseif store.cont.name="part4" then7 C0 E4 M3 c5 o6 C R+ e/ b! w
store.cont.move;, M9 v3 R3 I T4 j8 H8 K ~3 ]. V4 M
end;1 ]/ J, c, ?3 f; f9 L$ w" z
end; |
|