|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。, L3 y" U7 x3 |$ i0 F, _8 z3 f& ^
is
+ |+ i) u% Z+ G5 S# Z a,b:integer;
( Q# }: X4 m8 V- `1 w/ x5 jdo
* k0 j5 o! U) g% ] ] if store.cont.name="part1" then
8 A* ?2 x$ C- U. \; F for a:=1 to 4 loop1 s4 j" G! ]3 N( c% |3 c
store.cont.move;
% x+ L4 F; b/ x next;
" a6 I x$ ? y! y8 }! }% ` m elseif store.cont.name="part2" then* V5 w$ J& r# @
for b:=1to 3 loop
& ]8 z+ s) P7 J store.cont.move; l, x% J4 z [: R' z& a3 B
next;
4 @& Y0 R m4 A* s3 C elseif store.cont.name="part3" then, v3 l4 h* Z# h
store.cont.move;0 u# A" j5 s2 ~- Z% b
elseif store.cont.name="part4" then
" h; M. u! X0 d5 R! `# [, T9 Y store.cont.move;
) M1 [! I# K" P( M+ r1 T0 ^# r end;
: p' X- D& I8 H. q4 G( T' j# v end; |
|