|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
- U4 u; S, O# Q! M+ Zis
# q, s3 {4 a8 T- C/ G4 V a,b:integer;
- ~% J# l; m ydo) \- x0 L6 H+ K- i% g7 Z
if store.cont.name="part1" then4 M+ i; O7 F( {
for a:=1 to 4 loop( a7 q4 }7 {4 |
store.cont.move;
/ m* f0 o- T. I z9 Q2 N* D" y next;4 F3 \. G! I) u! _; c( H
elseif store.cont.name="part2" then
( }1 n* l3 H! J& A0 @. H for b:=1to 3 loop0 S4 f: ~# c- H' [
store.cont.move;6 z$ x; I8 d) p, R# X
next;
5 z" v/ H7 O s! V3 V elseif store.cont.name="part3" then
5 L, O. r) R3 g8 @2 r store.cont.move;2 I9 l2 c$ L8 b" h `8 d
elseif store.cont.name="part4" then; ~* @* l( Z5 ]9 O9 J
store.cont.move;
6 p. k3 f1 i( s# E/ J/ V/ ?$ o end;' {! E% K6 U" E* R0 Z O. i( n" K
end; |
|