|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
+ |7 M. B, C8 Zis % o F' s' i. w& M7 D$ y
a,b:integer;
/ T. H. p9 A, _, v5 Y3 v' y1 _do( y6 M( v4 Z" u" }
if store.cont.name="part1" then
9 c( _$ p7 L4 y, M. ^ b0 ~3 X for a:=1 to 4 loop
" \6 O) L' M; N store.cont.move;
" N+ U6 N, N1 c0 h0 n1 { next;' x! F. H3 u4 Y* l0 r T
elseif store.cont.name="part2" then
n9 h% F; m/ `9 `/ _" L& ^ K. ]6 | for b:=1to 3 loop! G/ P4 Z( R% o7 ~
store.cont.move;- [; d, o _9 v# R) }; R, U
next;. i. q' J7 v' ]6 i- ?3 g. o
elseif store.cont.name="part3" then$ |% X) d7 `9 R+ P# H- |4 ^
store.cont.move;$ ^0 b/ E+ ~2 n+ Q
elseif store.cont.name="part4" then
, t* @+ Y6 v" T6 t t store.cont.move;! p8 Y/ Q+ N' b/ H B
end;5 h4 N% Q; h/ ~, \& p; Z* m
end; |
|