|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。4 u( p7 N6 D. S/ ` s8 V
is
; W9 b9 f: H" h% s4 v/ L a,b:integer;
% Z3 B' s0 l) d' k+ W5 G# cdo7 g- t9 l8 w6 B6 G9 Q6 W: p8 C, B
if store.cont.name="part1" then
8 ? X p# ^) J |0 T# e _/ F8 I for a:=1 to 4 loop9 n) }9 B, {% L; f+ m) D
store.cont.move;
9 I6 j }) J$ c# S: @8 K next;2 O( j/ h# `$ G' [4 R, @7 t3 u
elseif store.cont.name="part2" then/ A* `) Q8 p$ Q- ^ {0 W: y
for b:=1to 3 loop
: A, @8 `3 M3 T" ^3 D store.cont.move;9 y- {- L3 k- e L5 f4 E0 s
next;) n1 e0 t; `! `5 l
elseif store.cont.name="part3" then
' \, ^7 S K) R, p; [" q4 f) x; } store.cont.move;
) o0 }9 f% b5 } elseif store.cont.name="part4" then) d7 o3 P3 X, l) n/ c0 B% n
store.cont.move;
8 S; G7 p8 S1 {5 ? end;$ r5 c. E+ b( { r- Y
end; |
|