|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
- N6 _" e0 b2 P* Zis
8 e- D5 H" A6 D/ `8 \" j a,b:integer;
( g6 W$ {) P- o% gdo" g3 h: i/ J% y% f8 Q
if store.cont.name="part1" then7 ~- V) [% C- `, v
for a:=1 to 4 loop# e6 h$ R% F7 q! b( B7 l6 s
store.cont.move;
' ~" k5 \9 b' F# z; K next;
: m4 h7 J" Z$ @8 \$ |$ x elseif store.cont.name="part2" then
3 ~% d$ v* u! ~/ q; j* J# k for b:=1to 3 loop
; m* b5 t! J+ r5 E store.cont.move;& e0 i( M2 l! c" B% T, W ?
next;5 y/ { T' W- e7 v$ l" ?
elseif store.cont.name="part3" then
6 _$ l3 q" k$ C+ ~ store.cont.move;
- G5 E# p3 h& [& h: U9 c elseif store.cont.name="part4" then" a% k5 ?; H, M8 w
store.cont.move;/ ^' x3 Q+ Y8 N
end;
u' I$ f* B! |* l end; |
|