// Token: 0x06000871 RID: 2161 RVA: 0x00024324 File Offset: 0x00022524
    protected override void Syncronize()
    {
        double time = global::Interpolation.time;
        global::CharacterStateInterpolatorData characterStateInterpolatorData;

        if (this.Sample(ref time, out characterStateInterpolatorData))
        {
            global::Character idMain = base.idMain;
            if (idMain)
            {
                idMain.origin     = characterStateInterpolatorData.origin;
                idMain.eyesAngles = characterStateInterpolatorData.eyesAngles;
                global::CharacterStateFlags stateFlags = idMain.stateFlags;
                idMain.stateFlags = characterStateInterpolatorData.state;
                if (!stateFlags.Equals(characterStateInterpolatorData.state))
                {
                    if (!this.once)
                    {
                        idMain.Signal_State_FlagsChanged(true);
                        this.once = true;
                    }
                    else
                    {
                        idMain.Signal_State_FlagsChanged(false);
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
 // Token: 0x06003853 RID: 14419 RVA: 0x000C7E98 File Offset: 0x000C6098
 internal void HandleChangedStateFlags(global::CharacterStateFlags flags, bool notFromLoading)
 {
     if ((byte)(this.caps & global::ItemModRepresentation.Caps.BindStateFlags) == 2 && (this._lastFlags == null || !this._lastFlags.Value.Equals(flags)))
     {
         this.BindStateFlags(flags, (!notFromLoading) ? global::ItemModRepresentation.Reason.Initialization : global::ItemModRepresentation.Reason.Explicit);
         this._lastFlags = new global::CharacterStateFlags?(flags);
     }
 }
    // Token: 0x06000868 RID: 2152 RVA: 0x00023594 File Offset: 0x00021794
    public void SetGoals(Vector3 pos, global::Angle2 rot, global::CharacterStateFlags state, double timestamp)
    {
        global::CharacterStateInterpolatorData characterStateInterpolatorData;

        characterStateInterpolatorData.origin     = pos;
        characterStateInterpolatorData.eyesAngles = rot;
        characterStateInterpolatorData.state      = state;
        base.SetGoals(ref characterStateInterpolatorData, ref timestamp);
    }
    // Token: 0x06003893 RID: 14483 RVA: 0x000C8ED8 File Offset: 0x000C70D8
    protected global::CharacterStateFlags GetCharacterStateFlags()
    {
        if (this.CheckParent() && this._parentMain is global::Character)
        {
            global::CharacterStateFlags stateFlags = ((global::Character)this._parentMain).stateFlags;
            this.lastCharacterStateFlags = new global::CharacterStateFlags?(stateFlags);
            return(stateFlags);
        }
        global::CharacterStateFlags?characterStateFlags = this.lastCharacterStateFlags;

        return((characterStateFlags == null) ? default(global::CharacterStateFlags) : characterStateFlags.Value);
    }
Ejemplo n.º 5
0
 // Token: 0x06003852 RID: 14418 RVA: 0x000C7D58 File Offset: 0x000C5F58
 internal void Initialize(global::ItemRepresentation itemRep, int modSlot, global::CharacterStateFlags flags)
 {
     if (this._modSlot == -1)
     {
         if (!itemRep)
         {
             throw new ArgumentOutOfRangeException("itemRep", itemRep, "!itemRep");
         }
         if (modSlot < 0 || modSlot >= 5)
         {
             throw new ArgumentOutOfRangeException("modSlot", modSlot, "modSlot<0||modSlot>=MAX_SUPPORTED_ITEM_MODS");
         }
         this._itemRep = itemRep;
         this._modSlot = modSlot;
         if ((byte)(this.caps & global::ItemModRepresentation.Caps.Initialize) == 1)
         {
             try
             {
                 this.Initialize();
             }
             catch (Exception)
             {
                 this._itemRep = null;
                 this._modSlot = -1;
                 throw;
             }
         }
         this.HandleChangedStateFlags(flags, false);
     }
     else
     {
         if (this._modSlot == -2)
         {
             throw new InvalidOperationException("This ItemModRepresentation has been destroyed");
         }
         if (itemRep != this._itemRep || (modSlot < 0 && modSlot < 5 && modSlot != this._modSlot))
         {
             throw new InvalidOperationException(string.Format("The ItemModRepresentation was already initialized with {{\"item\":\"{0}\",\"slot\":{1}}} and cannot be re-initialized to use {{\"item\":\"{2|\",\"slot\":{3}}}", new object[]
             {
                 this._itemRep,
                 this._modSlot,
                 itemRep,
                 modSlot
             }));
         }
     }
 }
    // Token: 0x0600386F RID: 14447 RVA: 0x000C86A8 File Offset: 0x000C68A8
    protected virtual void StateSignalReceive(global::Character character, bool treatedAsFirst)
    {
        global::CharacterStateFlags stateFlags = character.stateFlags;

        if (this.lastCharacterStateFlags != null && this.lastCharacterStateFlags.Value.Equals(stateFlags))
        {
            return;
        }
        this.lastCharacterStateFlags = new global::CharacterStateFlags?(stateFlags);
        for (int i = 0; i < 5; i++)
        {
            if (this._itemMods[i].representation)
            {
                this._itemMods[i].representation.HandleChangedStateFlags(stateFlags, !treatedAsFirst);
            }
        }
    }
    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: 0x06000862 RID: 2146 RVA: 0x00023354 File Offset: 0x00021554
 public static void WriteCharacterStateFlags(this BitStream stream, global::CharacterStateFlags v)
 {
     stream.WriteUInt16(v.flags);
 }
 // Token: 0x06000864 RID: 2148 RVA: 0x00023380 File Offset: 0x00021580
 public static void Serialize(this BitStream stream, ref global::CharacterStateFlags v)
 {
     stream.Serialize <ushort>(ref v.flags, new object[0]);
 }
Ejemplo n.º 10
0
 // Token: 0x06003856 RID: 14422 RVA: 0x000C8014 File Offset: 0x000C6214
 protected virtual void BindStateFlags(global::CharacterStateFlags flags, global::ItemModRepresentation.Reason reason)
 {
 }
 // Token: 0x06003A64 RID: 14948 RVA: 0x000CD0BC File Offset: 0x000CB2BC
 protected override void BindStateFlags(global::CharacterStateFlags flags, global::ItemModRepresentation.Reason reason)
 {
     base.BindStateFlags(flags, reason);
     base.SetOn(flags.laser, reason);
 }
 // 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();
            }
        }