コード例 #1
0
    public override void Initialize(System.IO.BinaryReader reader, RecordHeader header)
    {
        while (reader.BaseStream.Position < header.DataEndPos)
        {
            var subRecordType = (SubRecordType)reader.ReadInt32();
            var size          = reader.ReadInt32();

            switch (subRecordType)
            {
            case SubRecordType.Id:
                name = reader.ReadString(size);
                break;

            case SubRecordType.Data:
                type = (SoundGeneratorType)reader.ReadInt32();
                break;

            case SubRecordType.SoundName:
                sound = Record.GetRecord <SoundRecord>(reader.ReadString(size));
                break;

            case SubRecordType.CreatureName:
                creature = Record.GetRecord <CreatureRecord>(reader.ReadString(size));
                break;

            default:
                throw new NotImplementedException(subRecordType.ToString());
            }
        }
    }
コード例 #2
0
 public SoundGenerator(SoundGeneratorType type, string soundName) : base(new object())
 {
     Type      = type;
     SoundName = soundName;
 }