|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
$ o$ [% p8 f1 q/ e& o; jis # s0 L9 L1 g! w6 }
a,b:integer;
$ m+ r- H* X. C5 P1 T8 E+ ddo& a+ }9 o/ U# t: m
if store.cont.name="part1" then
( q! M' J9 e `# ?1 n for a:=1 to 4 loop
2 W7 @* z* [0 M5 e store.cont.move;
; F3 g4 n$ w) L$ b" f% f* V# K next;
- a; S1 U4 `" [0 j; Q' | elseif store.cont.name="part2" then
/ ?7 A# |8 e& f9 ] for b:=1to 3 loop( Q. O, u; q: v6 f, d
store.cont.move;. f2 \' z2 R9 S
next;9 m/ K/ G: Q; x8 V
elseif store.cont.name="part3" then
7 q" |( n) N3 w9 W8 N/ C store.cont.move;
* @# P6 ?0 q; i A( U4 ~ e5 l elseif store.cont.name="part4" then
k$ m8 _8 Z- s store.cont.move;
9 E( D+ {$ J# s* Z2 F8 t end;
2 `- F I( y: o1 j4 n) K end; |
|