from enum import Enum, Flag
from typing import List
from olives_types import Position2
from olives_gamestate import GameState

class Object:
    """
    This is the wrapper around the C++ "Object" class. Do not confuse this with the
    "AbstractObject" python class, which is the basis for game play behaviour of objects
    the player can control and is implemented purely in Python.

    The "olives" prefix in the file indicates it is not meant to be edited for modifying,
    as this will most definitely result in breakage.
    """

    def set_target(self, pos: Position2, rotate_pos: Position2, speed: MovingSpeed): ...
    def get_calculated_action_points(self, game_state: GameState) -> List[Position2]: ...
    def get_calculated_entry_points(self, game_state: GameState, slot_type: SlotType, skip_occupancy_check: bool = False, slot_id: int = -1) -> List[Position2]: ...
    def get_slot_position_from_entry_point_position(self, game_state: GameState, slot_type: SlotType, entry_point: Position2, skip_occupancy_check: bool = False) -> Position2: ...
    def get_position(self) -> Position2 : ...
    def get_container_id(self) -> int: ...
    def try_enter_object(self, container: Object, game_state: GameState, contained_status: ContainedStatus, animation: str) -> bool: ...
    def has_path_to(self, game_state: GameState, pos: Position2) -> bool: ...
    def clear_running_job(self): ...
    def get_is_moving(self) -> bool: ...
    def get_navigation_status(self) -> NavigationStatus: ...
    def get_contained_status(self) -> ContainedStatus: ...
    def set_contained_status(self, contained_status: ContainedStatus): ...
    def get_position_status(self) -> PositionStatus: ...
    def set_position_status(self, position_status: PositionStatus): ...
    def get_contained_status_change(self) -> ContainedStatusChange: ...
    def add_job_message(self, message_type: MessageType, context_id: int, context_param: str, pos1: Position2, pos2: Position2): ...
    """
    There is no setter for the active state, as that needs to be controlled through the game state 
    """
    def get_is_active(self) -> bool: ...
    def get_category(self) -> ObjectCategory: ...

class MovingSpeed(Enum):
    HALT = 0,
    WALKING = 1

class NavigationStatus(Enum):
    SUCCESS = 0,
    FAIL = 1,
    ONGOING = 2

class ContainedStatus(Enum):
    NONE = 0,
    ACTIVE = 1,
    PASSIVE = 2,
    EXTERNALLY_CONTROLLED = 3

class ContainedStatusChange(Enum):
    NONE = 0,
    ENTERING = 1,
    EXITING = 2

class PositionStatus(Enum):
    STANDING = 0,
    SITTING = 1,
    LYING = 2

class MessageType(Enum):
    CHANGE_OBJECT = 0,
    CHANGE_POSITION_DOOR_VISIBILITY = 1,
    REMOVE_LIGHT = 2

class SlotType(Enum):
    UNDEFINED = 0,
    SITTING = 1,
    LYING = 2,
    JOB = 4,
    ALL = 7

class ObjectCategory(Flag):
    CONTROLLABLE = 1,
    ACTIVE = 2,
    PASSIVE = 4,
    UNLISTED = 8,
    WALL_MOUNTED = 16,
    SITTING_CONTAINER = 32,
    LYING_CONTAINER = 64,
    JOB_CONTAINER = 128,
    LIGHT_SOURCE = 256,
    FEW_TICKS_REQUIRED = 512,
    TOGGLABLE = 1024,
    TEMP_MODIFIER_SOURCE = 2048,
    WALL_MOUNTED_SLIM = 4096,
    ALL = 8192