33 lines
772 B
C#
33 lines
772 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ApiServer.Structures
|
|
{
|
|
public class TechCycle
|
|
{
|
|
public sbyte Index { get; set; }
|
|
public string Start { get { return start.ToString("yyyy.MM.dd HH:mm:ss"); } }
|
|
public DateTime start = new DateTime();
|
|
|
|
public TechCycle(DateTime date, string line)
|
|
{
|
|
var splits = line.Split('\t');
|
|
if (splits[0] == "00")
|
|
this.Index = -1;
|
|
else
|
|
this.Index = sbyte.Parse(splits[0]);
|
|
var times = splits[1].Split(":");
|
|
this.start = new DateTime(
|
|
date.Year,
|
|
date.Month,
|
|
date.Day,
|
|
int.Parse(times[0]),
|
|
int.Parse(times[1]),
|
|
int.Parse(times[2])
|
|
);
|
|
}
|
|
}
|
|
}
|