from __future__ import annotations

from AoE2ScenarioParser.helper.retriever import get_retriever_by_name
from AoE2ScenarioParser.helper.retriever_object_link import RetrieverObjectLink
from AoE2ScenarioParser.objects.aoe2_object import AoE2Object
from AoE2ScenarioParser.pieces.structs.variable import VariableStruct


class VariableObject(AoE2Object):
    """Object for handling a variable."""

    _link_list = [
        RetrieverObjectLink("variable_id", "TriggerPiece.variable_data[__index__].variable_id"),
        RetrieverObjectLink("name", "TriggerPiece.variable_data[__index__].name"),
    ]

    def __init__(self, variable_id: int, name: str):
        self.variable_id = variable_id
        self.name = name

        super().__init__()
