# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\situations\ambient\ambient_situation_commands.py
# Compiled at: 2018-02-28 23:47:17
# Size of source mod 2**32: 2571 bytes
from world.lot_tuning import LotTuningMaps
import sims4.commands

def _get_lot_tuning(_connection):
    lot_tuning = LotTuningMaps.get_lot_tuning()
    if lot_tuning is None:
        sims4.commands.output("Could not find any LotTuning for the current lot. Please check world.lot_tuning's maps for adding a LotTuning guidance.", _connection)
    return lot_tuning


@sims4.commands.Command('walkby.print_lot_tuning')
def print_lot_tuning(_connection=None):
    lot_tuning = _get_lot_tuning(_connection)
    if lot_tuning is not None:
        sims4.commands.output('{}'.format(lot_tuning), _connection)


@sims4.commands.Command('walkby.print_desired_sim_count')
def print_desired_sim_count(_connection=None):
    lot_tuning = _get_lot_tuning(_connection)
    if lot_tuning is None:
        return 0
    walkby = lot_tuning.walkby
    if walkby is None:
        sims4.commands.output('{} does not have an associated WalkbyTuning.'.format(lot_tuning), _connection)
        return 0
    count = walkby.get_desired_sim_count()
    sims4.commands.output('Desired Sims: lower_bound:{} upper_bound:{}.'.format(count.lower_bound, count.upper_bound), _connection)
    return count


@sims4.commands.Command('walkby.pick_ambient_walkby_situation')
def pick_ambient_walkby_situation(_connection=None):
    lot_tuning = _get_lot_tuning(_connection)
    if lot_tuning is None:
        return
    walkby = lot_tuning.walkby
    if walkby is None:
        sims4.commands.output('{} does not have an associated WalkbyTuning.'.format(lot_tuning), _connection)
        return
    situation = walkby.get_ambient_walkby_situation(None)
    sims4.commands.output('Ambient Walkby Situation: {}.'.format(situation), _connection)
    return situation