|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
$ I8 j" q+ I4 X& j$ X# z- Yis G1 O( s( Q. f* [. W! T6 m
a,b:integer;8 r. s# P% y. h1 [
do' u0 ^( o' K. u* e( T5 ^2 M7 [) _9 m
if store.cont.name="part1" then
0 Z2 ^$ ?- N, h% g' e; h$ ^ for a:=1 to 4 loop, H5 C2 z+ p% n: y" N3 y
store.cont.move;, @# q0 L# y8 d% l# t( ]
next;
6 M2 ]* \0 j) }* U: f o elseif store.cont.name="part2" then* r1 l" i w! V- h
for b:=1to 3 loop- p: `9 z9 q# m2 R, S0 \. ~3 u
store.cont.move;
" c( A' Y& m2 Q& [2 b next;7 O7 l0 E2 F% x% o& S
elseif store.cont.name="part3" then
( [, D5 D( Z# r; W4 p+ L store.cont.move;6 i, A* D3 Y- |# C3 j, |: f
elseif store.cont.name="part4" then
: n/ F, {8 e5 d5 w. Z! I* ^ store.cont.move;
- c, X- G9 K, U# @3 w& A end;# M" j3 u" K6 K% @* k$ s, f/ S
end; |
|