Untitled

 avatar
unknown
plain_text
2 years ago
1.2 kB
5
Indexable
class Genre:
    def __init__(self, type, players):
        self.type = type
        self.players = players

    def gameplay(self):
        return f'Игроки: {self.players}, игра {self.type}'

    def start_game(self):
        self.gameplay()
        if str(self.players)[len(str(self.players)) - 1] == '1':
            print('Игра в жанре %s для %s игрока запущена.' % (self.type, self.players))
        else:
            print('Игра в жанре %s для %s игроков запущена.' % (self.type, self.players))


class ActionGenre(Genre):
    def __init__(self, players):
        super().__init__('Action', players)

    def gameplay(self):
        return 'Игроки : %s' % self.players


class StrategyGenre(Genre):
    def __init__(self, players):
        super().__init__('Strategy', players)

    def gameplay(self):
        return 'Игроки : %s' % self.players


class RPG(Genre):
    def __init__(self, players):
        super().__init__('RPG', players)

    def __str__(self):
        self.start_game()

    def gameplay(self):
        return 'Игроки : %s' % self.players
Editor is loading...