|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。; J9 `+ `( B3 r4 L6 q. ]
is
$ ?' ?2 W6 m" K8 H4 | a,b:integer;
1 n: D% o) g7 k' [do5 n8 g% W! D- q% U+ P& `
if store.cont.name="part1" then' _" r# y. e. ^
for a:=1 to 4 loop
) M7 B$ p4 V. |7 J: Y2 F store.cont.move;% `9 Z% Z! H `! v8 l9 s
next;
7 Z- I8 J/ S% x) c; |+ q: p2 k elseif store.cont.name="part2" then1 S( Z, x7 b# H' q) Q( s
for b:=1to 3 loop
0 ]4 |5 b, K) W5 p$ l8 F store.cont.move;
6 S, }6 Q- p2 L# U next;) c) `7 Z6 }/ O8 N. o M3 U
elseif store.cont.name="part3" then
* u! F" t' C! c, `2 g store.cont.move;+ ]' ]* C' M' J9 `
elseif store.cont.name="part4" then2 @( s, ~- m7 M( v4 `
store.cont.move;! l7 e0 q/ B h5 P' q
end;
. ^3 P. D. l9 E( E6 |" `' V end; |
|