Exemple #1
0
 public static void Write(PhysicalObject.Appendage appendage, ref BinaryWriter writer)
 {
     writer.Write(appendage.appIndex);
     writer.Write(appendage.canBeHit);
     writer.Write(appendage.segments.Length);
     for (int a = 0; a < appendage.segments.Length; a++)
     {
         Vector2Handler.Write(appendage.segments[a], ref writer);
     }
     writer.Write(appendage.totalLength);
 }
Exemple #2
0
            public static PhysicalObject.Appendage Read(PhysicalObject.Appendage appendage, ref BinaryReader reader)
            {
                appendage.appIndex = reader.ReadInt32();
                appendage.canBeHit = reader.ReadBoolean();
                int numberOfSegments = reader.ReadInt32();

                appendage.segments = new Vector2[numberOfSegments];
                for (int a = 0; a < numberOfSegments; a++)
                {
                    appendage.segments[a] = Vector2Handler.Read(ref reader);
                }
                appendage.totalLength = reader.ReadSingle();
                return(appendage);
            }
 public Pos(PhysicalObject.Appendage appendage, int prevSegment, float distanceToNext)
 {
     this.appendage      = appendage;
     this.prevSegment    = prevSegment;
     this.distanceToNext = distanceToNext;
 }