|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
2 C& W6 T' I; v3 k" ois
2 {$ p! c7 R$ D$ ?: V0 L4 T/ v7 g a,b:integer;
3 c' @ |% D: H% h( S f4 mdo! M, D& e! }/ I# s$ I% `8 f( c E
if store.cont.name="part1" then
4 v6 z- H3 Q! T for a:=1 to 4 loop
) E/ ]. W% y3 t& K- K store.cont.move;
S/ `- z& ^8 m7 R# r next;
} S7 x U' k' n( Q: s, X elseif store.cont.name="part2" then- J& X% o. M0 t3 w ]
for b:=1to 3 loop$ g% d8 q; L# H' b. \4 v
store.cont.move;
( A; k& Y6 m# F4 `1 [4 ~/ Y* G4 R next;2 V' p2 r2 Y+ \" ]+ @
elseif store.cont.name="part3" then
, b0 @1 t4 q" ]8 Y' W5 D$ F8 F, J store.cont.move;0 n, x' V/ b. q. C6 ^
elseif store.cont.name="part4" then- p, P0 c/ w: ~+ s ]; H% V0 |
store.cont.move;
- F V; ?# H) g* t1 g, t% m end;
/ T2 V6 C X# x1 g. A end; |
|