Пример #1
0
 public static void Write(Stream output, Unit instance, Endian endian)
 {
     output.WriteValueB8(instance.IsEnabled);
     output.WriteBytes(instance.NameBytes);
     ArrayHelper.ForEach(instance.BattleCries, e => BattleCry.Write(output, e), BattleCryCount);
     output.WriteValueU8(instance.Unknown1EE);
     output.WriteValueU8(instance.IdNumber);
     instance.State.Write(output, endian);
 }
Пример #2
0
        public static Unit Read(Stream input, Endian endian)
        {
            Unit instance;

            instance.IsEnabled   = input.ReadValueB8();
            instance.NameBytes   = input.ReadBytes(NameLength);
            instance.BattleCries = new BattleCry[BattleCryCount];
            for (int i = 0; i < BattleCryCount; i++)
            {
                instance.BattleCries[i] = BattleCry.Read(input);
            }
            instance.Unknown1EE = input.ReadValueU8();
            instance.IdNumber   = input.ReadValueU8();
            instance.State      = UnitState.Read(input, endian);
            return(instance);
        }
Пример #3
0
 public static void Write(Stream output, BattleCry instance)
 {
     output.WriteValueB8(instance.IsEnabled);
     output.WriteValueU8(instance.Type);
     output.WriteBytes(instance.MessageBytes);
 }