// Token: 0x06003892 RID: 14482 RVA: 0x000C8E28 File Offset: 0x000C7028
 private void InstallMod(ref global::ItemRepresentation.ItemModPair to, int slot, global::ItemModDataBlock datablock, global::CharacterStateFlags flags)
 {
     to.dataBlock = datablock;
     if (to.representation)
     {
         this.KillModRep(ref to.representation, false);
     }
     if (to.dataBlock.hasModRepresentation && to.dataBlock.AddModRepresentationComponent(base.gameObject, out to.representation))
     {
         to.bindState = global::ItemRepresentation.BindState.None;
         to.representation.Initialize(this, slot, flags);
         if (to.representation)
         {
             if (this.worldModels)
             {
                 this._itemMods.BindAsProxy(slot, this);
             }
         }
         else
         {
             to.bindState      = global::ItemRepresentation.BindState.Vacant;
             to.representation = null;
         }
     }
 }
        // Token: 0x060038A0 RID: 14496 RVA: 0x000C9404 File Offset: 0x000C7604
        public void InstallMod(int slotNumber, global::ItemRepresentation owner, global::ItemModDataBlock datablock, global::CharacterStateFlags flags)
        {
            switch (slotNumber)
            {
            case 0:
                owner.InstallMod(ref this.a, 0, datablock, flags);
                break;

            case 1:
                owner.InstallMod(ref this.b, 1, datablock, flags);
                break;

            case 2:
                owner.InstallMod(ref this.c, 2, datablock, flags);
                break;

            case 3:
                owner.InstallMod(ref this.d, 3, datablock, flags);
                break;

            case 4:
                owner.InstallMod(ref this.e, 4, datablock, flags);
                break;

            default:
                throw new IndexOutOfRangeException();
            }
        }
Пример #3
0
    // Token: 0x0600394E RID: 14670 RVA: 0x000CABA4 File Offset: 0x000C8DA4
    public void AddMod(global::ItemModDataBlock mod)
    {
        this.RecalculateMods();
        int usedModSlots = this.usedModSlots;

        this._itemMods[usedModSlots] = mod;
        this.RecalculateMods();
        this.OnModAdded(mod);
        base.MarkDirty();
    }
Пример #4
0
 // Token: 0x0600394F RID: 14671 RVA: 0x000CABDC File Offset: 0x000C8DDC
 public int FindMod(global::ItemModDataBlock mod)
 {
     if (mod)
     {
         for (int i = 0; i < 5; i++)
         {
             if (this._itemMods[i] == mod)
             {
                 return(i);
             }
         }
     }
     return(-1);
 }
    protected void Mods(byte[] data)
    {
        this.ClearMods();
        BitStream bitStream = new BitStream(data, false);
        byte      b         = bitStream.ReadByte();

        if (b > 0)
        {
            global::CharacterStateFlags characterStateFlags = this.GetCharacterStateFlags();
            for (int i = 0; i < (int)b; i++)
            {
                int uniqueID = bitStream.ReadInt32();
                global::ItemModDataBlock itemModDataBlock = (global::ItemModDataBlock)global::DatablockDictionary.GetByUniqueID(uniqueID);
                this._itemMods.InstallMod(i, this, itemModDataBlock, characterStateFlags);
                this._modFlags |= itemModDataBlock.modFlag;
            }
        }
    }
 // Token: 0x060033D4 RID: 13268 RVA: 0x000C26D4 File Offset: 0x000C08D4
 int FindMod(global::ItemModDataBlock mod)
 {
     return(base.FindMod(mod));
 }
 // Token: 0x060033D3 RID: 13267 RVA: 0x000C26C8 File Offset: 0x000C08C8
 void AddMod(global::ItemModDataBlock mod)
 {
     base.AddMod(mod);
 }
Пример #8
0
 // Token: 0x06003950 RID: 14672 RVA: 0x000CAC1C File Offset: 0x000C8E1C
 protected virtual void OnModAdded(global::ItemModDataBlock mod)
 {
 }
 // Token: 0x0600388E RID: 14478 RVA: 0x000C8D34 File Offset: 0x000C6F34
 private void EraseModDatablock(ref global::ItemModDataBlock block)
 {
     block = null;
 }