Пример #1
0
 private void SendUpdateControlBoxAction(UpdateControlBoxAction action, NetworkStream stream)
 {
     // ShapeType | Visible | start point | end point
     WriteInt((int) action.ShapeType, stream);
     WriteBool(action.ControlVisible, stream);
     WriteInt(action.StartPoint.X, stream);
     WriteInt(action.StartPoint.Y, stream);
     WriteInt(action.EndPoint.X, stream);
     WriteInt(action.EndPoint.Y, stream);
 }
Пример #2
0
        private UpdateControlBoxAction GetUpdateControlBoxAction(int senderId, NetworkStream stream)
        {
            // ShapeType | Visible | Start Point | End Point
            var action = new UpdateControlBoxAction(_manager.ClientList[senderId].ControlBox);
            action.ShapeType = (ShapeType)ReadInt(stream);
            action.ControlVisible = ReadBool(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;
        }