|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。' U B, g: G2 r* S- W. q2 {4 ]
is 0 f( g. F5 @% d3 i- l- @4 D
a,b:integer;7 `& V) y4 ?8 P% [* @
do
- {, E4 u; k- S, } if store.cont.name="part1" then M0 T* T: Y- `: G
for a:=1 to 4 loop
/ i+ b" I" U1 M) P) Z2 B store.cont.move;7 b) g" \0 }$ C* p4 P! t7 h! |
next;
& j* {7 V/ o( e f* S# t3 ~6 x elseif store.cont.name="part2" then2 [& `# Y- o8 N& s" u- f' F
for b:=1to 3 loop
( G7 W1 i# g0 w: D store.cont.move;
; ~8 k w- m5 S6 F next;) o, A `% {& }6 E% v3 y
elseif store.cont.name="part3" then
! b1 g0 E- ]+ T( _5 H store.cont.move;
, F1 o& p' M) _' U+ p8 c elseif store.cont.name="part4" then
: |+ z$ d1 P# G+ [ y0 U+ M9 ]# b store.cont.move;
: z" D; m7 G: w; K" | k end;
/ Y0 M7 C! f. K. H( ? end; |
|