|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
* I ^! c* o+ X1 R" e7 Gis
9 V0 T. n# ] w& ^3 Z# G$ c" e a,b:integer;0 b" g4 Z5 C$ z& G* Q. C/ z+ W0 t
do
9 Q/ o- o7 p- p3 `$ r0 x5 f if store.cont.name="part1" then7 d6 m( ^: x* v: m
for a:=1 to 4 loop
" N( |( w( I8 l: T0 P! g* g store.cont.move;7 s. n6 Z' Y$ ^7 ?" `; l! R* b
next;! A0 f, o7 T+ R. {" O
elseif store.cont.name="part2" then
5 o+ c Y. O# Q for b:=1to 3 loop
9 _1 d) G; M, a( C7 | store.cont.move;
4 h# I: Q1 d9 U7 G( W4 [; i next;
- t+ l7 \$ a& ]* m$ a* e3 L" r. G elseif store.cont.name="part3" then7 u, X4 {( O1 T& m, b6 D- [& ]" G! O
store.cont.move;, ~* c. \+ D$ c1 a" }. K- D. I
elseif store.cont.name="part4" then5 l; o' Y5 ?3 V) ]/ t
store.cont.move;! `- l$ C2 k" M4 H+ [- y
end;9 o B' V1 B6 X- W! a$ D' c; M, M* s
end; |
|