Example #1
0
        public override void OnUnEquipped(int index, IEquipmentCollection <IEquippableItemInstance> collection)
        {
            base.OnUnEquipped(index, collection);
            onUnEquippedCallCount++;

            _logger.Log($"{ToString()} unEquipped {onUnEquippedCallCount} times");
        }
Example #2
0
        private void Awake()
        {
            collection = new EquipmentCollection <IEquippableItemInstance>(0, GetComponent <IEquippableCharacter <IEquippableItemInstance> >(), _logger)
            {
                collectionName = collectionName
            };

            // col.GenerateSlots<EquipmentCollectionSlot<IEquippableItemInstance>>();

            CollectionRegistry.byName.Register(collectionName, collection);
            CollectionRegistry.byID.Register(_guid.guid, collection);

            _logger.LogVerbose($"Created and registered equipment collection with name {collectionName} and guid {_guid.guid}", this);
        }
        protected override void RegisterByName(IEquipmentCollection <IEquippableItemInstance> col)
        {
            if (CollectionRegistry.byName.Contains(collectionName))
            {
                if (!ignoreDuplicates)
                {
                    _logger.Error($"Collection with name {collectionName} already exists in CollectionRegistry", this);
                    return;
                }
                else
                {
                    _logger.Warning($"Equipment collection with name {collectionName} already exists in CollectionRegistry and will be overridden by this one. " +
                                    $"Use \"ignoreDuplicates = false\" to avoid collection override.", this);
                }
            }

            CollectionRegistry.byName.Register(collectionName, col);
        }
 public EquippableCharacter(IEquipmentCollection <TEquippableType> collection, CollectionGroup <TBaseType> restoreItemsToGroup, ILogger logger = null)
 {
     this.restoreItemsToGroup = restoreItemsToGroup ?? new CollectionGroup <TBaseType>();
     this.logger     = logger ?? new NullLogger();
     this.collection = collection;
 }
 protected override void RegiterByID(IEquipmentCollection <IEquippableItemInstance> col)
 {
     CollectionRegistry.byID.Register(collectionID, col);
 }
Example #6
0
 public virtual void OnEquipped(int index, IEquipmentCollection <IEquippableItemInstance> collection)
 {
     logger.LogVerbose("Item equipped! :: " + ToString(), this);
 }
 public virtual void OnUnEquipped(int index, IEquipmentCollection <IEquippableItemInstance> collection)
 {
 }