Ejemplo n.º 1
0
 def new_move(self,
              action=None,
              group=0,
              x_range=(0.0, WORLD_WIDTH),
              y_range=(0.0, WORLD_HEIGHT),
              vector=(0.0, 0.0),
              angle=0.0,
              factor=0.0,
              max_speed=0.0,
              max_angular_speed=0.0,
              vehicle_type=None,
              facility_id=-1,
              vehicle_id=-1):
     m = Move()
     m.action = action
     m.group = group
     m.left, m.right = x_range
     m.top, m.bottom = y_range
     m.x, m.y = vector
     m.angle = angle
     m.factor = factor
     m.max_speed = max_speed
     m.max_angular_speed = max_angular_speed
     m.vehicle_type = vehicle_type
     m.facility_id = facility_id
     m.vehicle_id = vehicle_id
     return m
Ejemplo n.º 2
0
 def expand(self, move: Move, x: float, y: float):
     move.action = ActionType.SCALE
     move.x = x
     move.y = y
     move.factor = 1.5
Ejemplo n.º 3
0
 def do_scale(s: MyStrategy, w: World, g: Game, m: Move):
     m.action = ActionType.SCALE
     m.factor = factor
     m.x = center.x
     m.y = center.y
Ejemplo n.º 4
0
 def shrink_selected(self, move: Move):
     move.x, move.y = self.my_x, self.my_y
     move.action = ActionType.SCALE
     move.factor = 0.1