public static bool Equal(this NEntity self, NEntity rhs) { if (self.Id != rhs.Id) { return(false); } if (self.Position == null) { if (rhs.Position != null) { return(false); } } else if (!self.Position.Equal(rhs.Position)) { return(false); } if (self.Direction == null) { if (rhs.Direction != null) { return(false); } } else if (!self.Direction.Equal(rhs.Direction)) { return(false); } return(true); }
public static string String(this NEntity self) { return(string.Format("({0}:pos:{1},dir:{2},spd:{3}", self.Id, self.Position.String(), self.Direction.String(), self.Speed)); }