You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.9 KiB
55 lines
1.9 KiB
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(); |
|
} |
|
} |