Ejemplo n.º 1
0
 public static void Save(BinaryWriter writer, SavedAnimPath path)
 {
     writer.WriteInt32((int)path.Flags);
     writer.Write(MemoryMarshal.Cast <sbyte, byte>(path.Deltas));
     writer.WriteInt32(path.Range);
     writer.WriteInt32((int)path.FieldD0);
     writer.WriteInt32(path.FieldD4);
     writer.WriteInt32(path.DeltaIdxMax);
     writer.WriteInt32(path.FieldDC);
     writer.WriteInt32(path.MaxPathLength);
     writer.WriteInt32(path.FieldE4);
     writer.WriteTileLocation(path.ObjectLoc);
     writer.WriteTileLocation(path.TargetLoc);
 }
Ejemplo n.º 2
0
    public static SavedAnimPath Load(BinaryReader reader)
    {
        var result = new SavedAnimPath();

        result.Flags  = (AnimPathFlag)reader.ReadInt32();
        result.Deltas = new sbyte[200];
        reader.Read(MemoryMarshal.Cast <sbyte, byte>(result.Deltas));
        result.Range         = reader.ReadInt32();
        result.FieldD0       = (CompassDirection)reader.ReadInt32();
        result.FieldD4       = reader.ReadInt32();
        result.DeltaIdxMax   = reader.ReadInt32();
        result.FieldDC       = reader.ReadInt32();
        result.MaxPathLength = reader.ReadInt32();
        result.FieldE4       = reader.ReadInt32();
        result.ObjectLoc     = reader.ReadTileLocation();
        result.TargetLoc     = reader.ReadTileLocation();
        return(result);
    }