|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。* o9 r+ E2 _0 @- p* \0 f( Z! o
is
. ~: v5 { K6 r* y) d a,b:integer;
4 h- F. M7 w# a* d7 vdo
, C' V; q/ k7 d if store.cont.name="part1" then
# }& P# K2 Y8 G% @1 i! } for a:=1 to 4 loop' p# g! [% \! D% w
store.cont.move;) ~& @. U: H: b2 H: d! u7 M) u
next;
+ F: c7 b. E6 A elseif store.cont.name="part2" then
4 T8 |( Y+ Q8 m2 j3 b8 }* a U" E- f for b:=1to 3 loop5 b' h3 [2 q. i" J* d
store.cont.move;
: R* X5 v4 s% A2 B- `* B0 P$ Q( A+ W next;
- x7 ^4 E, M( B7 N$ T/ Z [ elseif store.cont.name="part3" then
4 W7 C, J4 X4 ]- }9 K0 E+ A' w- v store.cont.move;/ [5 Y- a# y K. d7 Q# {
elseif store.cont.name="part4" then
% T& R* B d. C: s store.cont.move;
( E" t! F" p% e6 @! i end;
: H7 L$ V; }& V0 p end; |
|