Skip to content

Instantly share code, notes, and snippets.

@antoniel
Created April 24, 2022 17:39
Show Gist options
  • Save antoniel/39d88ee7f1e36518c4e52a677e85f7ec to your computer and use it in GitHub Desktop.
Save antoniel/39d88ee7f1e36518c4e52a677e85f7ec to your computer and use it in GitHub Desktop.
'''
┌──────────────────────────────────────────────────────────────────────┐
│ 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