示例#1
0
 private static Pat.PhysicalBox ImportPhysicalBox(GSPat.PhysicsBox box)
 {
     if (box == null)
     {
         return(null);
     }
     return(new PhysicalBox
     {
         X = Math.Min(box.X1, box.X2),
         Y = Math.Min(box.Y1, box.Y2),
         W = Math.Abs(box.X1 - box.X2),
         H = Math.Abs(box.Y1 - box.Y2),
     });
 }
示例#2
0
        private static PhysicsBox ReadPhysics(BinaryReader br)
        {
            if (!br.ReadBoolean())
            {
                return(null);
            }

            var ret = new PhysicsBox();

            ret.X1 = br.ReadInt32();
            ret.Y1 = br.ReadInt32();
            ret.X2 = br.ReadInt32();
            ret.Y2 = br.ReadInt32();

            return(ret);
        }