Пример #1
0
 /// <summary>
 /// Reads <see cref="Vector2Bool"/> instances from the current stream and returns them.
 /// </summary>
 /// <param name="self">The extended <see cref="BinaryDataReader"/>.</param>
 /// <param name="count">The number of instances to read.</param>
 /// <param name="format">The <see cref="BinaryBooleanFormat"/> in which values are stored.</param>
 /// <returns>The <see cref="Vector2Bool"/> instances.</returns>
 public static IList <Vector2Bool> ReadVector2Bools(this BinaryDataReader self, int count,
                                                    BinaryBooleanFormat format = BinaryBooleanFormat.NonZeroByte)
 {
     Vector2Bool[] values = new Vector2Bool[count];
     for (int i = 0; i < count; i++)
     {
         values[i] = self.ReadVector2Bool(format);
     }
     return(values);
 }
 /// <summary>
 /// Writes a <see cref="Vector2Bool"/> instance into the current stream.
 /// </summary>
 /// <param name="self">The extended <see cref="BinaryDataWriter"/>.</param>
 /// <param name="value">The <see cref="Vector2Bool"/> instance.</param>
 /// <param name="format">The <see cref="BinaryBooleanFormat"/> in which values are stored.</param>
 public static void Write(this BinaryDataWriter self, Vector2Bool value,
                          BinaryBooleanFormat format = BinaryBooleanFormat.NonZeroByte)
 {
     self.Write(value.X, format);
     self.Write(value.Y, format);
 }