Initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using Model.Immortal.Chart.Enums;
|
||||
|
||||
namespace Model.Immortal.Chart;
|
||||
|
||||
public class ChartModel {
|
||||
public List<PointModel> Points { get; set; } = new();
|
||||
public string ChartColor { get; set; } = ChartColorType.Red.ToString();
|
||||
|
||||
public int Offset { get; set; } = 0;
|
||||
public int IntervalDisplayMax { get; set; } = 300;
|
||||
public int ValueDisplayMax { get; set; } = 5000;
|
||||
|
||||
public float HighestIntervalPoint { get; set; } = 5000;
|
||||
public float HighestValuePoint { get; set; } = 5000;
|
||||
|
||||
public static List<ChartModel> GetAll() {
|
||||
var cs = new List<ChartModel>();
|
||||
|
||||
var c1 = new ChartModel {
|
||||
IntervalDisplayMax = 1000,
|
||||
ValueDisplayMax = 300,
|
||||
ChartColor = "Orange",
|
||||
Points = new List<PointModel>()
|
||||
};
|
||||
|
||||
for (var i = 0; i < c1.IntervalDisplayMax; i++)
|
||||
c1.Points.Add(new PointModel
|
||||
{ Interval = i, Value = (int)(i / (float)c1.IntervalDisplayMax * c1.ValueDisplayMax) });
|
||||
|
||||
cs.Add(c1);
|
||||
|
||||
return cs;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Model.Immortal.Chart.Enums;
|
||||
|
||||
public enum ChartColorType {
|
||||
Red,
|
||||
LightGreen,
|
||||
Cyan,
|
||||
Yellow,
|
||||
Orange,
|
||||
LightBlue,
|
||||
Pink
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Model.Immortal.Chart;
|
||||
|
||||
public class PointModel {
|
||||
public float Interval { get; set; } = 0;
|
||||
public float Value { get; set; } = 0;
|
||||
public float TempValue { get; set; } = 0;
|
||||
|
||||
public string GetInterval(float highestInterval, float displayScale) {
|
||||
var display = Interval / highestInterval * displayScale;
|
||||
return ((int)display).ToString();
|
||||
}
|
||||
|
||||
public string GetValue(float highestValue, float displayScale) {
|
||||
var display = Value / highestValue * displayScale;
|
||||
return ((int)display).ToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user