|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
( \: O+ o! S% W2 _$ L. K! O( Gis + {0 B7 h* }5 h4 q
a,b:integer;
2 @' f5 \, {% h: {$ ?4 ~0 I% cdo
M1 K9 y4 K0 v: y if store.cont.name="part1" then
2 @0 s* }2 n9 x8 R$ X, M for a:=1 to 4 loop( H$ v- Q2 K5 h( ^3 E" `& l
store.cont.move;4 B5 I( ?8 o; H
next;) _' n _! L5 B8 M2 O: \9 O; S' N
elseif store.cont.name="part2" then$ }7 i/ O# [2 {* h, Q1 a
for b:=1to 3 loop
1 q" y+ M8 n* d# ?4 b; `1 g store.cont.move;
/ q( Q V; S/ {% G# K1 G next;
5 u- `6 {: u9 s- Q) ^ { elseif store.cont.name="part3" then. r5 q$ |8 I- m& `8 Q; [$ q- b. b
store.cont.move;- {) j [9 M$ R+ ?0 W: g
elseif store.cont.name="part4" then
( Z$ u+ I/ ^5 I! `' D9 K9 l# F7 c" R store.cont.move;
/ E9 N3 n1 C* o: v1 | end;3 O6 c- U$ F. d/ K6 U
end; |
|