コード例 #1
0
    def __init__(self, make, model, year):
        """初始化父类的属性"""
        #super().__init__(make, model, year)
        Car.__init__(self, make, model, year)

        """将实例用作属性"""
        self.battery = Battery()
コード例 #2
0
    def __init__(self, type_of_car: str, model: str, name: str, **kwargs):
        """Constructor"""

        Car.__init__(self, type_of_car, model, name,
                     kwargs['amount_of_passengers'],
                     kwargs['amount_of_wheels'])
        Electricity.__init__(self, kwargs['voltage'], kwargs['amperage'])
 def __init__(self, name, color, year, charging_voltage, battery):
     Car.__init__(self, name, color, year)
     # super().__init__(self, name, color, year)
     # super(ElectricalCar, self).__init__(self, name, color, year)
     self.charging_voltage = charging_voltage
     self.battery = battery
     print('Khoi tao tai ElectricalCar')
コード例 #4
0
ファイル: atv.py プロジェクト: skandamurthy/vehicle
 def __init__(self, fuel_used, handle, is_gear, ac, steering_wheel,
              seat_belt, audio_player, no_of_wheels, speed, weight, milage,
              colour):
     self.fuel_used = fuel_used
     Bike.__init__(self, handle, is_gear, no_of_wheels, speed, weight,
                   milage, colour)
     Car.__init__(self, ac, steering_wheel, seat_belt, audio_player,
                  no_of_wheels, speed, weight, milage, colour)
コード例 #5
0
    def __init__(self, length, width, *groups):
        Car.__init__(self, length, width)
        pygame.sprite.Sprite.__init__(self, *groups)

        self.surface = pygame.Surface((self.length * 3, self.width * 3),
                                      pygame.SRCALPHA)
        self.shifts = (self.surface.get_width() / 2 - self.length / 2,
                       self.surface.get_height() / 2 - self.width / 2)

        self.wheel_image = pygame.Surface([self.length / 4, self.width / 12],
                                          pygame.SRCALPHA)
        self.wheel_image.fill(BLUE)

        self.render()
コード例 #6
0
 def __init__(self, car_data):
     Car.__init__(self, car_data)  #super().__init__(slef)
     self.car_data = car_data
コード例 #7
0
 def __init__(self, name):
     Car.__init__(self, name)
     print "SUV init called..."
コード例 #8
0
ファイル: aiCar.py プロジェクト: mzhua/python-learn
 def __init__(self):
     Car.__init__(self)
コード例 #9
0
 def __init__(self, name, color, year, charging_voltage):
     Car.__init__(self, name, color, year)
     self.charging_voltage = charging_voltage
コード例 #10
0
 def __init__(self, line, speed, people_carried):
     self.line = line
     self.closest_stop = None
     self.waiting_to_turn = False
     self.just_stopped = False
     Car.__init__(self, 0, 0, 1, speed, people_carried)
コード例 #11
0
 def __init__(self, license, driver, brand, model):
     Car.__init__(self, license, driver)
     self.brand = brand
     self.model = model
コード例 #12
0
 def __init__(self):
     Car.__init__(self)
     RentedItemMixin.__init__(self)
コード例 #13
0
 def __init__(self, name):
     Car.__init__(self, name)
     self.twingo_model = None
コード例 #14
0
 def __init__(self, brand, model, price, doors, voltage):
     Car.__init__(self, brand, model, price, doors)
     self.voltage = voltage
コード例 #15
0
 def __init__(self, yr=2016):
     Car.__init__(self, "Honda", "Civic")
     self.year = yr
コード例 #16
0
ファイル: bus.py プロジェクト: augustog/itba-ss-2014a
 def __init__(self, line, speed, people_carried):
     self.line = line
     self.closest_stop = None
     self.waiting_to_turn = False
     self.just_stopped = False
     Car.__init__(self, 0, 0, 1, speed, people_carried)
コード例 #17
0
 def __init__(self, make, model, year):
     """ Init parent """
     Car.__init__(self, make, model, year)
コード例 #18
0
 def __init__(self, license, driver, typeCarAccepted, seatsMaterial):
     Car.__init__(self, license, driver)
     self.typeCarAccepted = typeCarAccepted
     self.seatsMaterial = seatsMaterial
コード例 #19
0
 def __init__(self, x, y, world):
     Car.__init__(self, x, y)
     self.sensorModel = SensorModel()
     self.numParticles = 500
     self.particles = self.generateNParticles(self.numParticles, world)
コード例 #20
0
ファイル: taxi.py プロジェクト: hackettccp/CIS106
 def __init__(self, make_in, model_in, year_in, riders_in, doors_in):
     Bus.__init__(self, make_in, model_in, year_in, riders_in)
     Car.__init__(self, make_in, model_in, year_in, doors_in)
     self.meter = 5.0