|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。+ I# u& k# \6 c' ~5 N) Q% }
is * s; u" n/ p5 E* b. ^8 ^
a,b:integer;
+ a# w4 G, n* |do, r) I# Q. H" E/ Y1 W' K5 P0 \
if store.cont.name="part1" then
; e) j3 X( _, g9 ], l1 {* M- N for a:=1 to 4 loop
6 P+ |6 C% A5 s2 w) o store.cont.move;7 u6 R# |6 {5 H5 S( F/ u% F
next;5 C/ Q6 v# q: s- t- ~1 W# Y% ?
elseif store.cont.name="part2" then
" j$ M7 { L3 G for b:=1to 3 loop
/ w9 Z4 i: W; D1 i store.cont.move;6 @: a* A! @9 ]; ]) r) Q
next;0 H: c% D% a, V# v l6 U
elseif store.cont.name="part3" then
V) J1 f$ E2 s) Q) J store.cont.move;0 C( m" {; I' i% }. O& j0 l( c
elseif store.cont.name="part4" then
& [; E8 m7 Y/ B store.cont.move;
8 J; f3 s* y4 ~5 X6 D end;; q; }1 Q; ]+ r* t* Q5 @
end; |
|