2015-04-27 13:40:57 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
2017-06-12 17:47:31 -04:00
|
|
|
|
namespace SharedLibrary.Helpers
|
2015-04-27 13:40:57 -04:00
|
|
|
|
{
|
2015-08-22 02:04:30 -04:00
|
|
|
|
public class PlayerHistory
|
2015-04-27 13:40:57 -04:00
|
|
|
|
{
|
2017-09-27 16:07:43 -04:00
|
|
|
|
public PlayerHistory(int cNum)
|
2015-04-27 13:40:57 -04:00
|
|
|
|
{
|
2017-09-27 16:07:43 -04:00
|
|
|
|
DateTime t = DateTime.UtcNow;
|
|
|
|
|
When = new DateTime(t.Year, t.Month, t.Day, t.Hour, 5 * (int)Math.Round(t.Minute / 5.0), 0);
|
|
|
|
|
PlayerCount = cNum;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
|
public PlayerHistory(DateTime t, int cNum)
|
|
|
|
|
{
|
|
|
|
|
When = new DateTime(t.Year, t.Month, t.Day, t.Hour, 15 * (int)Math.Round(t.Minute / 15.0), 0);
|
|
|
|
|
PlayerCount = cNum;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
private DateTime When;
|
|
|
|
|
private int PlayerCount;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used by CanvasJS as a point on the x axis
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double x
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (When - DateTime.MinValue).TotalSeconds;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used by CanvasJS as a point on the y axis
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int y
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return PlayerCount;
|
|
|
|
|
}
|
2015-04-27 13:40:57 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|