示例#1
0
        /// <summary>
        /// Compare equality between two packets.
        /// </summary>
        /// <param name="thisPacket"></param>
        /// <param name="otherPacket"></param>
        /// <returns>True if they encode the same data, false otherwise or if 1 is null</returns>
        public static bool equals(IdPacket thisPacket, IdPacket otherPacket)
        {
            if ((thisPacket == null) || (otherPacket == null))
            {
                return(false);
            }

            return(thisPacket.ObjectId == otherPacket.ObjectId);
        }
示例#2
0
        /// <summary>
        /// Compare equality between two packets.
        /// </summary>
        /// <param name="thisPacket"></param>
        /// <param name="otherPacket"></param>
        /// <returns>True if they encode the same data, false otherwise or if 1 is null</returns>
        public static bool equals(RequestPacket thisPacket, RequestPacket otherPacket)
        {
            if ((thisPacket == null) || (otherPacket == null))
            {
                return(false);
            }

            return((thisPacket.DeltaX == otherPacket.DeltaX) && (thisPacket.DeltaZ == otherPacket.DeltaZ) &&
                   (thisPacket.DeltaRot == otherPacket.DeltaRot) && (IdPacket.equals(thisPacket.IdData, otherPacket.IdData)) &&
                   (thisPacket.ToolRequest == otherPacket.ToolRequest) && (thisPacket.ToolMode == otherPacket.ToolMode));
        }
示例#3
0
 public ObjectPacket(float positionX, float positionY, float positionZ,
                     float rotation, bool burning, float health, IdPacket idData) : base(PacketType.ObjectPacket)
 {
     PositionX = positionX;
     PositionY = positionY;
     PositionZ = positionZ;
     Rotation  = rotation;
     Burning   = burning;
     Health    = health;
     IdData    = idData;
 }
示例#4
0
 public RequestPacket(float deltaX, float deltaZ, float deltaRot, IdPacket idData,
                      ToolType toolReq, ToolMode toolMode, string name) : base(PacketType.RequestPacket)
 {
     DeltaX      = deltaX;
     DeltaZ      = deltaZ;
     DeltaRot    = deltaRot;
     IdData      = idData;
     ToolRequest = toolReq;
     ToolMode    = toolMode;
     Name        = name;
 }
示例#5
0
 public DestroyObjectPacket(IdPacket idData) : base(PacketType.DestroyObjectPacket)
 {
     this.idData = idData;
 }