from typing import override

from flut._flut.engine import FlutImmutableObject


class _Alignment(FlutImmutableObject):
    def __init__(self, x: float, y: float):
        super().__init__("Alignment")
        self.x = x
        self.y = y

    @override
    def _flut_pack(self) -> dict:
        result = self._flut_base_props()
        result["x"] = self.x
        result["y"] = self.y
        return result


class Alignment(_Alignment):
    topLeft = _Alignment(-1.0, -1.0)
    topCenter = _Alignment(0.0, -1.0)
    topRight = _Alignment(1.0, -1.0)
    centerLeft = _Alignment(-1.0, 0.0)
    center = _Alignment(0.0, 0.0)
    centerRight = _Alignment(1.0, 0.0)
    bottomLeft = _Alignment(-1.0, 1.0)
    bottomCenter = _Alignment(0.0, 1.0)
    bottomRight = _Alignment(1.0, 1.0)
