|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
7 b. E+ J2 D4 j; d4 |2 [1 Ris 3 ^5 {) H$ k" w6 ~3 ?9 N9 f6 X
a,b:integer;5 f: e( @6 Y" m* b0 B
do, B! o) \ y# l6 C
if store.cont.name="part1" then
9 U9 k' V* P+ N }4 \1 f for a:=1 to 4 loop
# Y: X& ?7 B: O7 D- @7 B; l store.cont.move;! P3 [ e4 ^* s# g# g3 B# b: c
next;
" D: J. o/ ?# @5 H ?2 G elseif store.cont.name="part2" then
% {/ P" `& B% h+ Z$ } for b:=1to 3 loop. T- ~! `: P8 ]) ]
store.cont.move;0 E$ g+ W7 E0 v+ R; M" a
next;" o* |6 J. ~+ }3 h& U+ b# f
elseif store.cont.name="part3" then0 o( b9 H5 t3 J. J4 S" J
store.cont.move;, a, h" b! r3 F% W" t1 h
elseif store.cont.name="part4" then
1 G, o: [1 g9 \! P store.cont.move;
7 |$ p# R. O4 p end;9 b& k) I4 M: { I" Q# G
end; |
|