namespace ServerApp
{
public class MaxDataSizeRecorder
{
public string Name = "NoName";
public int Point = 0;
public void SetPoint( string name, int point )
{
}
public bool IsHighest( int point )
{
return false;
}
}
}
メンバ変数の初期化コードを追加したMaxDataSizeRecorderクラス(C#版)
Public Class MaxDataSizeRecorder
Public Name As String = "NoName"
Public Point As Integer = 0
Public Sub SetPoint(ByVal name As String, ByVal point As Integer)
End Sub
Public Function IsHighest(ByVal point As Integer) As Boolean
Return False
End Function
End Class
namespace ServerApp
{
public class MaxDataSizeRecorder
{
public string Name = "NoName";
public int Point = 0;
public void SetPoint( string name, int point )
{
if( this.Point >= point ) return;
this.Name = name;
this.Point = point;
}
public bool IsHighest( int point )
{
return this.Point < point;
}
}
}
SetPointメソッドとIsHighestメソッドの追加(C#版)
Public Class MaxDataSizeRecorder
Public Name As String = "NoName"
Public Point As Integer = 0
Public Sub SetPoint(ByVal _name As String, ByVal _point As Integer)
If Me.Point >= _point Then Exit Sub
Me.Name = _name
Me.Point = _point
End Sub
Public Function IsHighest(ByVal _point As Integer) As Boolean
Return Me.Point < _point
End Function
End Class