コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SharedObject" /> class.
 /// </summary>
 /// <param name="zOrderList">The z order list.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="privateOwnerName">Name of the private owner.</param>
 /// <param name="gameElements">The game elements.</param>
 public SharedObject(List <SharedObject> zOrderList, int id, Rectangle rectangle, string privateOwnerName, List <GameElement> gameElements)
 {
     _zOrderList = zOrderList;
     Id          = id;
     // Apply magnetic grid at creation:
     rectangle.Location = ScgGameState.GetMagneticLocation(rectangle);
     Rectangle          = rectangle;
     GrabbedLocation    = new Point(Rectangle.Left, Rectangle.Top);
     PrivateOwnerName   = privateOwnerName;
     GameElements       = gameElements;
     GrabberName        = null;
 }