|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。- m- h( o0 B4 J6 n- l9 r, o! x
is
8 ^& o: c" C5 j/ k* y% [, y a,b:integer;
5 ^& [ B- W, E1 C" y# B9 Ddo. N! Y: ~+ G. s( z$ c/ x6 K# `
if store.cont.name="part1" then& g+ A8 B5 n0 s7 _/ z
for a:=1 to 4 loop4 G/ l c2 v8 X( S
store.cont.move;
2 J+ o( H! \8 p# c, T( r; K2 K next;/ B3 ]( _* s+ V* P: m3 b
elseif store.cont.name="part2" then
( K, c: T; `; t0 e. H for b:=1to 3 loop7 n3 j4 M: ~' V' q5 }4 L5 b/ y
store.cont.move;
, T" Z) f6 y V- @8 c0 U next;
$ _9 J: M5 h) N2 } elseif store.cont.name="part3" then8 P# C! K3 w) A) ~
store.cont.move;
% y7 D5 o# G7 {7 p elseif store.cont.name="part4" then
5 i; m) E+ [7 i store.cont.move;
5 o( a9 y; e6 H& t" U/ o end;; R% `# [$ c5 I* q+ g7 Q( C" G
end; |
|