|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。, Y3 y: D! M- m2 ?4 ]* B; U) {
is
( {1 w4 e- ?7 C! V! ` a,b:integer;3 I/ W9 B/ i m7 A; O
do
& i) G3 |+ P9 A; c. Y! Q9 ^ if store.cont.name="part1" then
( o# [! Y/ Z& O& t; n for a:=1 to 4 loop
/ d3 {% w3 z5 ?' B2 G/ s store.cont.move;
8 |3 L! w' c9 ]! |% H/ \" }# Q2 ? next;
* E7 r& c: J' ^! Y6 @$ x. h elseif store.cont.name="part2" then
* X5 W. W8 |! W$ p, E7 c for b:=1to 3 loop
/ T' r. h ^5 `* t5 `3 C& Y- }6 j* v store.cont.move;
: L- i a' f- Q: t. T2 o next;/ G0 t5 ]& d- Z( ?
elseif store.cont.name="part3" then
" q9 h" Y( U0 f4 n: [ store.cont.move;7 m4 h* t; w9 |9 B' ]$ q( \% ?
elseif store.cont.name="part4" then2 O! x1 t( B: K$ b/ o4 k( G" U2 |
store.cont.move;
1 x" I- Y" t4 a0 i, O' K( n end;
3 V' e" h1 G e" T end; |
|