Beispiel #1
0
 private void SendLoadControlBoxAction(LoadControlBoxAction action, NetworkStream stream)
 {
     // ShapeType | start point | end point
     WriteInt((int)action.ShapeType, stream);
     WriteInt(action.StartPoint.X, stream);
     WriteInt(action.StartPoint.Y, stream);
     WriteInt(action.EndPoint.X, stream);
     WriteInt(action.EndPoint.Y, stream);
 }
Beispiel #2
0
        private LoadControlBoxAction GetLoadControlBoxAction(int senderId, NetworkStream stream)
        {
            var action = new LoadControlBoxAction(_manager.ClientList[senderId].ControlBox);
            action.ShapeType = (ShapeType)ReadInt(stream);
            var sx = ReadInt(stream);
            var sy = ReadInt(stream);
            action.StartPoint = new Point(sx, sy);

            var ex = ReadInt(stream);
            var ey = ReadInt(stream);
            action.EndPoint = new Point(ex, ey);

            return action;
        }