示例#1
0
 protected Color getColor(HIRCType t)
 {
     return(t switch
     {
         HIRCType.SoundSXFSoundVoice => intColor,
         HIRCType.EventAction => interpDataColor,
         HIRCType.Event => boolColor,
         HIRCType.ActorMixer => stringColor,
         //HIRCType.Settings => expr,
         //HIRCType.RandomOrSequenceContainer => expr,
         //HIRCType.SwitchContainer => expr,
         //HIRCType.AudioBus => expr,
         //HIRCType.BlendContainer => expr,
         //HIRCType.MusicSegment => expr,
         //HIRCType.MusicTrack => expr,
         //HIRCType.MusicSwitchContainer => expr,
         //HIRCType.MusicPlaylistContainer => expr,
         //HIRCType.Attenuation => expr,
         //HIRCType.DialogueEvent => expr,
         //HIRCType.MotionBus => expr,
         //HIRCType.MotionFX => expr,
         //HIRCType.Effect => expr,
         //HIRCType.AuxiliaryBus => expr,
         _ => Color.Black
     });
示例#2
0
            public static HIRCObject Create(SerializingContainer2 sc)
            {
                HIRCType type = (HIRCType)(sc.Game == MEGame.ME3 ? sc.ms.ReadByte() : (byte)sc.ms.ReadInt32());
                int      len  = sc.ms.ReadInt32();
                uint     id   = sc.ms.ReadUInt32();

                return(type switch
                {
                    HIRCType.SoundSXFSoundVoice => SoundSFXVoice.Create(sc, id, len),
                    HIRCType.Event => Event.Create(sc, id),
                    HIRCType.EventAction => EventAction.Create(sc, id, len),
                    _ => new HIRCObject
                    {
                        Type = type,
                        ID = id,
                        unparsed = sc.ms.ReadBytes(len - 4)
                    }
                });
        public static IHIRCObject GetObject(HIRCType type, byte[] data)
        {
            switch (type)
            {
                case HIRCType.ActorMixer:
                case HIRCType.Attenuation:
                case HIRCType.AudioBus:
                case HIRCType.AuxiliaryBus:
                case HIRCType.Effect:
                case HIRCType.Settings:
                case HIRCType.SwitchContainer:
                case HIRCType.Unknown:
                    return new GenericObject(type, data);

                case HIRCType.SoundFX:
                    return new SoundFXObject(data);

                default:
                    throw new NotImplementedException(type.ToString());
            }
        }
示例#4
0
        public static IHIRCObject GetObject(HIRCType type, byte[] data)
        {
            switch (type)
            {
            case HIRCType.ActorMixer:
            case HIRCType.Attenuation:
            case HIRCType.AudioBus:
            case HIRCType.AuxiliaryBus:
            case HIRCType.Effect:
            case HIRCType.Settings:
            case HIRCType.SwitchContainer:
            case HIRCType.Unknown:
                return(new GenericObject(type, data));

            case HIRCType.SoundFX:
                return(new SoundFXObject(data));

            default:
                throw new NotImplementedException(type.ToString());
            }
        }
示例#5
0
        public HIRCSection(byte[] data)
        {
            Data = data;

            using (MemoryStream s = new MemoryStream(data))
            {
                UInt32 objectCount = s.ReadUInt32();
                for (int i = 0; i < objectCount; i++)
                {
                    Console.Write("HIRC object at: {0:X}", s.Position);
                    HIRCType type   = (HIRCType)s.ReadUInt8();
                    UInt32   length = s.ReadUInt32();
                    byte[]   buffer = new byte[length];
                    s.Read(buffer, 0, (int)length);

                    Console.WriteLine(" Type {0} Length {1:X}", type, length);

                    IHIRCObject obj = HIRCObject.GetObject(type, buffer);
                    Objects.Add(obj);
                }
            }
        }
 public GenericObject(HIRCType type, byte[] data)
 {
     Type = type;
     Data = data;
     Console.WriteLine("Generic Object: {0} length: {1:X}", type, data);
 }
示例#7
0
 public static string GetHircObjTypeString(HIRCType ht) =>
 ht switch
 {
示例#8
0
 public GenericObject(HIRCType type, byte[] data)
 {
     Type = type;
     Data = data;
     Console.WriteLine("Generic Object: {0} length: {1:X}", type, data);
 }