|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。. u6 W- D/ M: r+ j& c3 N
is
. D1 W4 D% A+ K9 P! q) Y' ^% z a,b:integer;) f( X% o+ U2 F& c5 n* F1 h
do$ k, V: j3 E1 N, B5 ?/ o
if store.cont.name="part1" then7 ]( Z* F% O' p" \: R
for a:=1 to 4 loop
& o( I m3 ^# ]! A D1 B$ o store.cont.move;" n9 M, n1 o4 g. U6 e3 Q
next;
( W. y# b% R$ U4 v' T- w: w3 C( H elseif store.cont.name="part2" then2 t7 N9 R6 |6 o1 V7 |
for b:=1to 3 loop
Z- q8 m& N% L+ U store.cont.move;! V7 W4 S& [) _6 h# k
next;
9 w8 X; ]" c: i& o6 z elseif store.cont.name="part3" then0 f1 d8 k* h9 G. x
store.cont.move;
' N$ \7 I+ b( d5 g; L elseif store.cont.name="part4" then
: c% \' s) W7 R ~ store.cont.move;6 {4 E8 E( b; [) W" t: I' w
end;3 j! [9 w, z6 k* D
end; |
|