|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。7 h* f8 d9 E2 d8 R. q1 s$ W/ O3 L
is
7 F2 H# n: A r, r a,b:integer;; `( X5 f% l( U. d4 i, w, k/ G/ w
do
9 f% ~2 o* f3 E- d9 F if store.cont.name="part1" then
{4 i4 r" N* Z& P# N( }" z" D for a:=1 to 4 loop
2 w8 b/ `, I; e" k/ a store.cont.move; o( _) E6 a' n% b$ E' U
next;
s7 I m; x! w/ N# t elseif store.cont.name="part2" then0 N# J- X2 l- A$ Z5 M7 u+ W
for b:=1to 3 loop- x( n7 m2 j' ^; x C, g4 ]) _0 t# X
store.cont.move;
& m C( Y5 r# Y# r: l/ N, X next;6 [ ~( w: u, H7 ^* i) e" V/ Z. {
elseif store.cont.name="part3" then ]- {1 {3 p) `) S
store.cont.move;
; g) l# E& x2 f7 t7 B elseif store.cont.name="part4" then$ y$ }1 b* E; Z, I* ^
store.cont.move;
+ ?# k) ?+ s z" i end;% ?; n5 f5 a1 I' |# X0 c7 _
end; |
|