<commit_before>import math

import time

from RULEngine.Debug.debug_interface import DebugInterface
from RULEngine.Util.Position import Position
from RULEngine.Util.geometry import get_distance, get_angle
from ai.STA.Action.Idle import Idle
from ai.STA.Tactic.Tactic import Tactic
from ai.STA.Tactic.tactic_constants import Flags
from ai.Util.Raycast import raycast

MAX_WIDTH_TO_PASS = 100


class StandOutWaitPass(Tactic):

    def __init__(self, game_state, player_id, target, args):
        super().__init__(game_state, player_id, target, args)

        self.current_state = self.stand_out
        self.next_state = self.stand_out
        self.kicker_id = int(args[0])
        self.debug = DebugInterface()
        self.time_waiting = time.time()

    def stand_out(self) -> None:
        self.status_flag = Flags.WIP
        if self.am_i_standing_out():
            self.next_state = self.stand_out
        else:
            self.next_state = self.stand_out
        return Idle(self.game_state, self.player_id)

    def am_i_standing_out(self) -> bool:
        player_pos = self.game_state.get_player_position(self.player_id)
        kicker_pos = self.game_state.get_player_position(self.kicker_id)
        distance_to_kicker = get_distance(player_pos, kicker_pos)
        angle_kicker_to_player = get_angle(kicker_pos, player_pos)
        is_standing_out = raycast(self.game_state, kicker_pos, distance_to_kicker, angle_kicker_to_player,
                                  MAX_WIDTH_TO_PASS, [self.player_id, self.kicker_id], [], True)

        if is_standing_out:
            self.next_state = self.am_i_standing_out
        else:
            self.next_state = self.wait_for_pass
        self.debug.add_log(1, str(is_standing_out))
        return True

    def wait_for_pass(self):
        self.next_state = self.wait_for_pass<commit_msg>tactic standoutwaitpass can know if he's standing out<commit_after>import math

import time

from RULEngine.Debug.debug_interface import DebugInterface
from RULEngine.Util.Position import Position
from RULEngine.Util.geometry import get_distance, get_angle
from ai.STA.Action.Idle import Idle
from ai.STA.Tactic.Tactic import Tactic
from ai.STA.Tactic.tactic_constants import Flags
from ai.Util.Raycast import raycast

MAX_WIDTH_TO_PASS = 100


class StandOutWaitPass(Tactic):

    def __init__(self, game_state, player_id, target, args):
        super().__init__(game_state, player_id, target, args)

        self.current_state = self.stand_out
        self.next_state = self.stand_out
        self.kicker_id = int(args[0])
        self.debug = DebugInterface()
        self.time_waiting = time.time()

    def stand_out(self) -> None:
        self.status_flag = Flags.WIP

        if self.am_i_standing_out():
            self.next_state = self.stand_out
        else:
            self.next_state = self.wait_for_pass
        return Idle(self.game_state, self.player_id)

    def am_i_standing_out(self) -> bool:
        player_pos = self.game_state.get_player_position(self.player_id)
        kicker_pos = self.game_state.get_player_position(self.kicker_id)
        distance_to_kicker = get_distance(player_pos, kicker_pos)
        angle_kicker_to_player = get_angle(kicker_pos, player_pos)
        is_standing_out = raycast(self.game_state, kicker_pos, distance_to_kicker, angle_kicker_to_player,
                                  MAX_WIDTH_TO_PASS, [self.player_id, self.kicker_id], [], True)

        self.debug.add_log(1, str(not is_standing_out))
        return not is_standing_out

    def wait_for_pass(self):
        self.next_state = self.wait_for_pass
{'fraction_non_alphanumeric': 0.08065410199556541, 'fraction_numerical': 0.002771618625277162, 'mean_word_length': 3.1965116279069767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6870423', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1171, 'n_words': 219}