#pass
#건물
class BuildingUnit(Unit):
def __init__(self, name, hp, location):
pass #μΌλ¨ λμ΄κ°λ€.
#μνλΌμ΄ λνΏ : 건물 1κ° μμΌλ©΄ 8 μ λ μμ±
supply_depot = BuildingUnit("μνλΌμ΄ λνΏ", 500, "7μ")
#Another example
def game_start():
print("[μλ¦Ό] μλ‘μ΄ κ²μμ μμν©λλ€.")
def game_over():
pass
============
Super
class Flyable:
def __int__(self):
print("FlyableFF μμ±μ")
class Unit:
def __init__(self):
print("Unit μμ±μ")
class FlyableUnit(Unit, Flyable):
def __init__(self):
#super().__init__() #superλ₯Ό μΈ λ, λ§μ§λ§ μμ λ°λ κ²μ λν init ν¨μκ° νΈμΆλλ€
Unit.__init__(self)
Flyable.__init__(self)
#λλμ½
dropship = FlyableUnit()
???μ μλμ§
'Coding > Python' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[python] ν΄λμ€ ν΄μ¦ (0) | 2021.11.03 |
---|---|
[python] νμ΄μ¬μΌλ‘ λ§λ μ€νν¬λννΈ (0) | 2021.11.03 |
[python] ν΄λμ€(λ©μλ μ€λ²λΌμ΄λ©) (0) | 2021.11.03 |
[python] ν΄λμ€(λ€μ€μμ) (0) | 2021.11.03 |
[python] ν΄λμ€(ν΄λμ€, __init__, λ©€λ²λ³μ) (0) | 2021.11.01 |