|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。) g. A# v! Q7 J! [, H1 o, I
is
/ _* y- S3 p' [* f/ D" B# L8 W a,b:integer;+ i# L/ \, c& }) P V, h& h
do
6 f% Y4 n# Q- r/ k+ s4 h# n if store.cont.name="part1" then# E ~& O2 [* c- g# o+ p# p2 y6 w
for a:=1 to 4 loop
5 Z2 b4 t: E( C) y* y& W# @ store.cont.move;+ K8 W' N b: Y+ e5 R
next;
7 _- |) R1 b. J! {. R2 { elseif store.cont.name="part2" then
9 f& R0 {9 Z/ ?3 S, x* B. s for b:=1to 3 loop
0 a3 x3 ~4 X4 K& e0 v. d+ G$ H store.cont.move;. s/ h1 e7 D6 K: X
next;8 z" g4 S4 |; x) O* n
elseif store.cont.name="part3" then
8 ?/ W" e. H5 Z store.cont.move;! P: [. y/ j T2 U' S
elseif store.cont.name="part4" then
* [, H& X2 Z0 M; }! M store.cont.move;( K( `8 I; N) V/ E
end;9 j( m; D/ Z( x7 I+ i, Z
end; |
|