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
Esempio n. 2
0
 def select_all(self, move: Move, vehicle_type=None, add_to_selection=False):
     move.action = ActionType.CLEAR_AND_SELECT if not add_to_selection else ActionType.ADD_TO_SELECTION
     move.left = 0.0
     move.top = 0.0
     move.right = self.game.world_width
     move.bottom = self.game.world_height
     if vehicle_type is not None:
         move.vehicle_type = vehicle_type
Esempio n. 3
0
 def do_select(s: MyStrategy, w: World, g: Game, m: Move, a=area):
     m.action = action
     #print("Selecting: " + str(a))
     m.left = a.left - fuzz
     m.right = a.right + fuzz
     m.top = a.top
     m.bottom = a.bottom
     m.group = group
     m.vehicle_type = vtype