/// <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); }
/// <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)); }
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; }
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; }
public DestroyObjectPacket(IdPacket idData) : base(PacketType.DestroyObjectPacket) { this.idData = idData; }