mirror of
https://github.com/zoriya/AnonymousGoose.git
synced 2026-06-02 05:55:09 +00:00
Finishing the abstract trick class
This commit is contained in:
@@ -2,5 +2,13 @@ from trick import Trick
|
||||
|
||||
|
||||
class TestTrick(Trick):
|
||||
@property
|
||||
def name(self):
|
||||
return "Test"
|
||||
|
||||
@property
|
||||
def delay(self):
|
||||
return 1
|
||||
|
||||
def run(self):
|
||||
print("Test succeed")
|
||||
|
||||
@@ -3,9 +3,15 @@ from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class Trick(ABC):
|
||||
def __init__(self):
|
||||
self.name = "Undefined"
|
||||
self.delay = 1
|
||||
@property
|
||||
@abstractmethod
|
||||
def name(self):
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def delay(self):
|
||||
return 1
|
||||
|
||||
@abstractmethod
|
||||
def run(self):
|
||||
|
||||
Reference in New Issue
Block a user