from sqlalchemy import Column, Enum, Integer, String, Float

from components.component import Component, component_repr
from components.enums import WeaponType, ElementalEffect


class Weapon(Component):
    """Represent the weapon info of an item."""
    __tablename__ = 'weapon'
    id = Column(Integer, primary_key=True)
    entity = Column(Integer, unique=True, index=True, nullable=False)
    damage = Column(String(50), nullable=False, default=1)
    projectiles = Column(Integer)
    accuracy = Column(Integer)

    def __repr__(self):
        return component_repr(self)
