|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
0 ~! T- o2 s9 O3 [: qis
, H6 v/ R$ E! G! E a,b:integer;. f8 p! ?8 l! X/ _8 o) o
do, X( R: H* ]& ~; @
if store.cont.name="part1" then# Y" Y& [' o+ `
for a:=1 to 4 loop
1 L2 z$ T2 L! y9 N* Y: c) n, _& @/ P store.cont.move;
8 O8 d8 ^9 C# N* P# T$ j next;
( G# V$ {) `! `3 l/ y elseif store.cont.name="part2" then
0 Y* D1 Z+ A) ?$ c4 J7 A for b:=1to 3 loop
7 a4 w. F9 v( V8 g1 a store.cont.move;3 ?5 c: Q) V4 y. U
next;
* g% d ?9 G; K% a8 J) x' l9 O- B elseif store.cont.name="part3" then
% P; L6 l% d1 D0 p2 H store.cont.move;5 T- @1 n8 d' ]7 t
elseif store.cont.name="part4" then
: U3 J# F+ i: S) T/ e7 Q+ b; w1 A store.cont.move;
% r* ]8 {$ O4 [% L# g& E8 } end; A* X, ?/ s8 V
end; |
|