from database.models.common.Model import Model
from sqlalchemy import Column, Integer, String
from database.services.DbService import Base


class MatchCardState(Model, Base):
    GRAVEYARD = "graveyard"
    HAND = "hand"
    PLAY = "play"
    LIBRARY = "library"
    STATES = [LIBRARY, HAND, PLAY, GRAVEYARD]

    __tablename__ = 'match_card_state'
    id = Column(Integer, primary_key=True)
    name = Column(String)

    def get_id(self):
        return self.id

    def set_name(self, value):
        Model.validate_set_property(value, 'name', str, self.STATES)
        self.name = value
        return self

    def get_name(self):
        return self.name
