|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
! f& B7 ~' K, f9 B7 bis
/ I7 g2 P3 h+ } a,b:integer;
$ p: J6 | @3 {- ?7 E! G$ \do6 s% u4 g! F& _ H
if store.cont.name="part1" then- @7 y. U8 B9 D
for a:=1 to 4 loop
: N3 U( A3 V" Q( h$ Z5 L store.cont.move;
/ ~' ?0 x7 E; u" W5 Z$ C next;1 k% h8 B0 S" U% u" U8 i6 c
elseif store.cont.name="part2" then
7 h, p1 @ \! f for b:=1to 3 loop# l1 h x8 o. A; `& L
store.cont.move;5 K [* q) o: p _. o" W+ b6 x
next;
6 `- n: d3 n3 p7 j5 A- |" s5 N elseif store.cont.name="part3" then" @/ Q: G8 H% U' y+ f) n6 u, V: c0 U
store.cont.move;3 i- H9 ?# p6 D6 T
elseif store.cont.name="part4" then
" R/ Q9 T5 v2 d! U: g" M3 H store.cont.move;
5 ^) M) t, x' }' O0 `4 R end;8 m. K& K) W8 J* t6 v% b. W8 v4 C
end; |
|