|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。: f( p# t4 a7 M" |3 X: b
is
$ ^( F1 e" D( Q a,b:integer;
$ x, J( |, s4 `$ v7 w% bdo! V8 G0 f; s: v
if store.cont.name="part1" then
; q# c1 ?4 G+ @4 E& m; w for a:=1 to 4 loop
: D# Q$ L& u- ]' n( U store.cont.move;/ ~) F2 L! n6 j
next;' C/ h6 i& \4 R
elseif store.cont.name="part2" then
% l, W s+ f( n1 r& p for b:=1to 3 loop
( }6 Z& v" X( @1 j d store.cont.move;# ^1 r) b- T( q; {- [# o9 i: ~
next;$ A' P) ]. f4 T, X' T2 k8 y4 W6 m
elseif store.cont.name="part3" then; b$ ~5 D. v# I3 c3 {7 N
store.cont.move;7 T$ R. z6 z+ H5 q9 N
elseif store.cont.name="part4" then
3 w, p3 E' v# k. c store.cont.move;9 S- V3 Z7 \8 ?4 u* f2 i
end;7 y! K! d' _4 i
end; |
|