Custom Enum Types

Float Enum

class CommonEnumFloat(enum_name, enum_value, class_name)

Bases: float

An enum that holds a float value.

Parameters:
  • enum_name (str) – The name of the enum.
  • enum_value (float) – The value of the enum.
  • class_name (str) – The name of the class containing the enum.
name

The name of the enum.

Returns:The name of the enum.
Return type:str
value

The value of the enum.

Returns:The value of the enum.
Return type:float

Float Enum Base

class CommonEnumFloatBase

Bases: float

An inheritable class to turn properties into float enums.

Int

class CommonInt

Bases: sims4communitylib.enums.enumtypes.common_int.Int

An inheritable class that inherits from the vanilla Sims 4 enum.Int class so you don’t have to.

Int Enum

class CommonEnumInt(enum_name, enum_value, class_name)

Bases: int

An enum that holds an integer value.

Parameters:
  • enum_name (str) – The name of the enum.
  • enum_value (int) – The value of the enum.
  • class_name (str) – The name of the class containing the enum.
name

The name of the enum.

Returns:The name of the enum.
Return type:str
value

The value of the enum.

Returns:The value of the enum.
Return type:int

Int Enum Base

class CommonEnumIntBase

Bases: int

An inheritable class to turn properties into integer enums.

Warning

This class is obsolete, please inherit from CommonInt instead.

Int Flags

class CommonIntFlags

Bases: sims4communitylib.enums.enumtypes.common_int_flags.IntFlags

An inheritable class that inherits from the vanilla Sims 4 enum.IntFlags class so you don’t have to.

Object Enum

class CommonEnumObject(enum_name, enum_value, class_name)

Bases: object

An enum that holds an object value.

Parameters:
  • enum_name (str) – The name of the enum.
  • enum_value (object) – The value of the enum.
  • class_name (str) – The name of the class containing the enum.
name

The name of the enum.

Returns:The name of the enum.
Return type:str
value

The value of the enum.

Returns:The value of the enum.
Return type:object

Object Enum Base

class CommonEnumObjectBase

Bases: object

An inheritable class to turn properties of the class into object enums.

String Enum

class CommonEnumString(enum_name, enum_value, class_name)

Bases: str

An enum that holds a string value.

Parameters:
  • enum_name (str) – The name of the enum.
  • enum_value (str) – The value of the enum.
  • class_name (str) – The name of the class containing the enum.
name

The name of the enum.

Returns:The name of the enum.
Return type:str
value

The value of the enum.

Returns:The value of the enum.
Return type:str

String Enum Base

class CommonEnumStringBase

Bases: str

An inheritable class to turn properties into string enums.

Versioned Int

class CommonVersionedInt

Bases: sims4communitylib.enums.enumtypes.common_int.CommonInt, sims4communitylib.enums.enumtypes.common_versioned_values_mixin.CommonVersionedValuesMixin

Integer, but with a version.

classmethod convert_obsolete_value(value)

Convert an obsolete value to its new equivalent, if there is one.

classmethod get_obsolete_values() → Set[sims4communitylib.enums.enumtypes.common_versioned_int.CommonVersionedInt]

Retrieve a set of values considered as obsolete.

classmethod get_version() → str

The version of the enum. If this changes, it means values have changed and should be updated.

classmethod is_obsolete_value(value: sims4communitylib.enums.enumtypes.common_versioned_int.CommonVersionedInt) → bool

Determine if a value is considered to be obsolete.

Versioned Int Flags

class CommonVersionedIntFlags

Bases: sims4communitylib.enums.enumtypes.common_int_flags.CommonIntFlags, sims4communitylib.enums.enumtypes.common_versioned_values_mixin.CommonVersionedValuesMixin

Integer flags, but with a version.

classmethod convert_obsolete_value(value)

Convert an obsolete value to its new equivalent, if there is one.

classmethod get_obsolete_values() → Set[sims4communitylib.enums.enumtypes.common_versioned_int_flags.CommonVersionedIntFlags]

Retrieve a set of values considered as obsolete.

classmethod get_version() → str

The version of the enum. If this changes, it means values have changed and should be updated.

classmethod is_obsolete_value(value: sims4communitylib.enums.enumtypes.common_versioned_int_flags.CommonVersionedIntFlags) → bool

Determine if a value is considered to be obsolete.

Versioned Values Mixin

class CommonVersionedValuesMixin

Bases: object

A mixin that provides versioning for values.

classmethod convert_obsolete_value(value)

Convert an obsolete value to its new equivalent, if there is one.

classmethod get_obsolete_values() → Set[sims4communitylib.enums.enumtypes.common_versioned_values_mixin.CommonVersionedValuesMixin]

Retrieve a set of values considered as obsolete.

classmethod get_version() → str

The version of the enum. If this changes, it means values have changed and should be updated.

classmethod is_obsolete_value(value: sims4communitylib.enums.enumtypes.common_versioned_values_mixin.CommonVersionedValuesMixin) → bool

Determine if a value is considered to be obsolete.