Created
April 24, 2022 17:39
-
-
Save antoniel/39d88ee7f1e36518c4e52a677e85f7ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
┌──────────────────────────────────────────────────────────────────────┐ | |
│ Iluminacao │ | |
├──────────────────────────────────────────────────────────────────────┤ | |
│ + status: boolean │ | |
├──────────────────────────────────────────────────────────────────────┤ | |
│ + ligar(): void │ | |
│ + desligar(): void │ | |
│ + getStatus(): boolean │ | |
└──────────────────────────────────────────────────────────────────────┘ | |
''' | |
class Iluminacao: | |
def __init__(self, status: bool) -> None: | |
self.status = status | |
def ligar(self) -> None: | |
self.status = True | |
def desligar(self) -> None: | |
self.status = False | |
def getStatus(self) -> bool: | |
return self.status | |
""" | |
┌──────────────────────────────────────────────────────────────────────┐ | |
│ Televisao │ | |
├──────────────────────────────────────────────────────────────────────┤ | |
│ + ligada: boolean │ | |
│ + canal: int │ | |
│ + volume: int │ | |
│ + smart: boolean │ | |
├──────────────────────────────────────────────────────────────────────┤ | |
│ + ligar(): void │ | |
│ + desligar(): void │ | |
│ + getLigada(): boolean │ | |
│ + getCanal(): int │ | |
│ + getVolume(): int │ | |
│ + getSmart(): boolean │ | |
│ + setLigada(ligada: boolean): void │ | |
│ + setCanal(canal: int): void │ | |
│ + setVolume(volume: int): void │ | |
│ + setSmart(smart: boolean): void │ | |
└──────────────────────────────────────────────────────────────────────┘ | |
""" | |
class Televisao: | |
ligada: bool | |
canal: int | |
volume: int | |
smart: bool | |
def __init__(self, ligada: bool, canal: int, volume: int, smart: bool) -> None: | |
self.ligada = ligada | |
self.canal = canal | |
self.volume = volume | |
self.smart = smart | |
def ligar(self) -> None: | |
self.ligada = True | |
def desligar(self) -> None: | |
self.ligada = False | |
def getLigada(self) -> bool: | |
return self.ligada | |
def getCanal(self) -> int: | |
return self.canal | |
def getVolume(self) -> int: | |
return self.volume | |
def getSmart(self) -> bool: | |
return self.smart | |
def setLigada(self, ligada: bool) -> None: | |
self.ligada = ligada | |
def setCanal(self, canal: int) -> None: | |
self.canal = canal | |
def setVolume(self, volume: int) -> None: | |
self.volume = volume | |
def setSmart(self, smart: bool) -> None: | |
self.smart = smart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment