|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
$ P* U9 q1 m6 Z* ?, }is
/ B1 u: m9 ]. K* o# F0 W a,b:integer;
& k, h# w- j6 \( |+ {8 ndo$ ~* x! c; o- ~, m
if store.cont.name="part1" then# |3 Q9 Y- p9 ~9 J3 [. N7 Y
for a:=1 to 4 loop0 P8 n7 c9 L- }* Q' |! a& R
store.cont.move;3 F3 y& H5 |$ } c$ X8 |
next;1 n ]" a" o% V! l% X
elseif store.cont.name="part2" then+ C+ C2 e. c0 g: X! Q
for b:=1to 3 loop9 N8 B$ m: M6 V# o: B
store.cont.move;
6 _( z' e5 A1 k( c+ X9 I next;. s/ K' `3 Z G4 B' P2 X
elseif store.cont.name="part3" then
4 M- k* m& R& c4 }0 w! A store.cont.move;
) E/ T! f& A# c; @2 W7 N elseif store.cont.name="part4" then/ Y: \3 W4 A5 ~4 |
store.cont.move;9 H7 W6 M2 I$ E4 M
end;
7 ?9 H! [# s& t8 a5 X# R end; |
|