|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。! X: a- U# F c# \ N
is
; h: {& o+ u5 }8 v& i& m$ U0 c a,b:integer;% A8 |* b& Y5 V9 F7 K
do1 b1 R! n& [/ `1 v) x9 _2 {
if store.cont.name="part1" then. g0 s+ J7 a- e7 |9 L5 J( C4 h2 l6 p. j
for a:=1 to 4 loop
4 i' X- L4 f: S& u* U" c# J store.cont.move;! G6 x. v1 D8 G
next;% e! b. w" G4 s+ t
elseif store.cont.name="part2" then
6 h1 q+ D. U6 @* ?* l$ ^3 b for b:=1to 3 loop
" C: f. i J& w" N& V; j store.cont.move;
7 w0 r& g) O+ N0 B6 B next;0 h" o0 P/ L' u0 Q8 p1 g
elseif store.cont.name="part3" then
% v0 u `; T4 d store.cont.move;
( i T. N/ G0 C& I8 N7 b+ U" u elseif store.cont.name="part4" then
3 R i/ [& A0 G2 } store.cont.move;
9 [. i3 _8 P* C: t) ^0 S end;
/ i/ f8 A- K' ~/ Q" d3 D end; |
|