public string DebugText() { StringBuilder s = new StringBuilder(); s.Append("{ [" + this.RawLength.ToString() + "] "); s.Append("[" + this.Type.ToString() + "] "); s.Append("[" + this.Originator.ToString() + "] "); if (Data is NetMouseState) { NetMouseState p = (NetMouseState)Data; s.Append(p.DebugString() + " }"); return(s.ToString()); } if (Data is NetKeyboardState) { NetKeyboardState p = (NetKeyboardState)Data; s.Append(p.DebugString() + " }"); return(s.ToString()); } if (Data is NetSprite) { NetSprite p = (NetSprite)Data; s.Append(p.DebugString() + " }"); return(s.ToString()); } s.Append("Malformed Payload }"); return(s.ToString()); }
public override bool Equals(object obj) { if (obj.GetType() != this.GetType()) { return(false); } NetMouseState other = (NetMouseState)obj; return(this.State.Equals(other.State)); }
public static void TestHarness() { MouseState curMouseState = Mouse.GetState(); System.Diagnostics.Debug.WriteLine(DebugString(curMouseState)); NetMouseState testState1 = new NetMouseState(curMouseState); byte[] testBytes1 = testState1.ToBytes(); System.Diagnostics.Debug.WriteLine(DebugString(testBytes1)); NetMouseState testState1b = new NetMouseState(testBytes1); System.Diagnostics.Debug.WriteLine(testState1b.DebugString()); }