|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
' v" J6 g0 r) R, d" Cis
' z: [' j- k: V a$ {3 i% C a,b:integer;
8 [5 f. A4 H+ w2 h& t0 D3 gdo* F; E4 P: Y6 s& }/ d/ Y
if store.cont.name="part1" then
' t( y( [' u7 ^ G for a:=1 to 4 loop
0 Z8 o7 Q0 J! \& y store.cont.move;1 Y% E* q8 w5 v$ j, b& m) r
next;
& B$ j' W, K" E' F# Q elseif store.cont.name="part2" then$ L# f5 Q: {+ ]. b9 X
for b:=1to 3 loop+ a2 y& n. c% h8 n+ Q' ~+ o: e
store.cont.move;3 e* G. e; @/ i6 b+ J6 \
next;
2 K9 l* v+ r$ v: n) E, y elseif store.cont.name="part3" then
: S1 S! h' J: [ store.cont.move;; M2 q) _+ x5 c" V! Z8 G1 Z4 G
elseif store.cont.name="part4" then
' M9 h9 j" K- ^: r2 ?, m; h0 V store.cont.move;
; c+ C) c4 Y- y# v0 B% q end;
& ^! |- ~& F6 u. t8 ~2 V7 f end; |
|