Classes

BB Singleton

class BBSingleton(*args, **kwargs)

Bases: type

Any instances created using this class will be of a single instance.

Usage: class Foo(metaclass=BBSingleton):

Example usage:

class Foo(metaclass=BBSingleton):
    def __init__(self):
        self.state = 0

f = Foo()
f.state = 3
g = Foo()
g.state == 3  # True

BB Enqueue Interaction Result

class BBEnqueueInteractionResult(test_result, execute_result)

Bases: EnqueueResult

The result of Enqueuing an interaction.

Parameters:
classmethod from_base(enqueue_result)

Convert an EnqueueResult into a BBEnqueueInteractionResult.

Parameters:

enqueue_result (EnqueueResult) – The EnqueueResult to convert.

Returns:

A BBEnqueueInteractionResult.

Return type:

BBEnqueueInteractionResult

to_base()

Convert this into a EnqueueResult.

Returns:

A EnqueueResult.

Return type:

EnqueueResult

BB Execute Interaction Result

class BBExecuteInteractionResult(result, interaction, reason)

Bases: ExecuteResult

The result of executing an interaction.

Parameters:
  • result (bool) – Set to True, if execution was successful. Set to False, if not.

  • interaction (Interaction) – The interaction that was executed.

  • reason (str) – The reason for a failure or success.

classmethod from_base(execute_result)

Convert an ExecuteResult into a BBExecuteInteractionResult.

Parameters:

execute_result (ExecuteResult) – The ExecuteResult to convert.

Returns:

A BBExecuteInteractionResult.

Return type:

BBExecuteInteractionResult

to_base()

Convert this into a ExecuteResult.

Returns:

A ExecuteResult.

Return type:

ExecuteResult

BB Run Result

class BBRunResult(result, reason, tooltip_text=None, icon=None, influence_by_active_mood=False)

Bases: TestResult

The result of running something.

Parameters:
  • result (Any) – The result of execution. Whether this is an Object, a Boolean, or some other Type.

  • reason (str) – The reason for the test result.

  • tooltip_text (Any, optional) – The text to show if the result is returned to a UI Element.

  • icon (Any, optional) – The icon to show with the result.

  • influence_by_active_mood (bool, optional) – True, if the result was influenced by the active Mood of a Sim. Default is False.

classmethod from_base(test_result)

Convert a TestResult into a BBRunResult.

Parameters:

test_result (TestResult) – The TestResult to convert.

Returns:

A BBRunResult

Return type:

BBRunResult

to_base()

Convert this into a TestResult.

Returns:

A TestResult.

Return type:

TestResult

BB Test Result

class BBTestResult(result, reason, tooltip_text=None, icon=None, influence_by_active_mood=False)

Bases: BBRunResult

The result of a test.

Parameters:
  • result (bool) – True, if the test was successful. False, if unsuccessful.

  • reason (str) – The reason for the test result.

  • tooltip_text (Any, optional) – The text to show if the result is returned to a UI Element.

  • icon (Any, optional) – The icon to show with the result.

  • influence_by_active_mood (bool, optional) – True, if the result was influenced by the active Mood of a Sim. Default is False.

classmethod from_base(test_result)

Convert a TestResult into a BBTestResult.

Parameters:

test_result (TestResult) – The TestResult to convert.

Returns:

A BBTestResult

Return type:

BBTestResult

reverse()

Flip the result of this TestResult and return a new BBTestResult.

Returns:

A new Test Result, but with a reversed “result” value.

Return type:

BBTestResult