weapons.dictionary module

Provides helper class to store weapon instances.

class weapons.dictionary.WeaponDictionary(factory=<class 'weapons._base.Weapon'>, *args, **kwargs)[source]

Bases: entities.dictionary.EntityDictionary

Helper class used to store weapon instances.

__init__(factory=<class 'weapons._base.Weapon'>, *args, **kwargs)[source]

Initializes the dictionary.

Parameters:
  • factory (callable) –

    Factory class or function used to create missing instances. Set to None to disable this feature.

    Factory signature: index, *args, **kwargs

  • args (tuple) – Arguments passed to the factory class or function.
  • kwargs (dict) – Keyword arguments passed to the factory class or function.