Initial commit

This commit is contained in:
2022-03-28 18:44:08 -04:00
commit e43d9a90e7
267 changed files with 17049 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace Model.Immortal.BuildOrders;
public class BuildComparisonModel {
public List<BuildOrderModel> Builds { get; set; } = new() {
new BuildOrderModel(),
new BuildOrderModel(),
new BuildOrderModel()
};
}
+55
View File
@@ -0,0 +1,55 @@
using System.Collections.Generic;
using System.Linq;
using Model.Immortal.Entity;
using Model.Immortal.Entity.Data;
namespace Model.Immortal.BuildOrders;
public class BuildOrderModel {
public string Name { get; set; } = "";
public string Color { get; set; } = "red";
public Dictionary<int, List<EntityModel>> Orders { get; set; } = new() {
{
0,
new List<EntityModel> {
EntityModel.Get(DataType.STARTING_Bastion),
EntityModel.Get(DataType.STARTING_TownHall_Aru)
}
}
};
public string Notes { get; set; } = @"";
public List<string> BuildTypes { get; set; } = new();
public List<EntityModel> GetOrdersAt(int interval) {
return (from ordersAtTime in Orders
from orders in ordersAtTime.Value
where ordersAtTime.Key == interval
select orders).ToList();
}
public List<EntityModel> GetCompletedAt(int interval) {
return (from ordersAtTime in Orders
from orders in ordersAtTime.Value
where ordersAtTime.Key + (orders.Production() == null ? 0 : orders.Production().BuildTime) == interval
select orders).ToList();
}
public List<EntityModel> GetCompletedBefore(int interval) {
return (from ordersAtTime in Orders
from orders in ordersAtTime.Value
where ordersAtTime.Key + (orders.Production() == null ? 0 : orders.Production().BuildTime) <= interval
select orders).ToList();
}
public List<EntityModel> GetHarvestersCompletedBefore(int interval) {
return (from ordersAtTime in Orders
from orders in ordersAtTime.Value
where ordersAtTime.Key + (orders.Production() == null ? 0 : orders.Production().BuildTime) <= interval
where orders.Harvest() != null
select orders).ToList();
}
}