adding farms

This commit is contained in:
hz
2026-05-19 15:40:31 -05:00
parent 0757344bdf
commit 864835a8f9
11 changed files with 241 additions and 39 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ public class LocationResponse
Label = location.Label,
Level = location.Level,
BuildingType = revealDetails ? location.BuildingType : null,
BuildingStatus = revealDetails && (location.BuildingType == "LogCamp" || location.BuildingType == "Mine" || location.BuildingType == "Barracks") && string.IsNullOrWhiteSpace(location.BuildingStatus)
BuildingStatus = revealDetails && (location.BuildingType == "LogCamp" || location.BuildingType == "Mine" || location.BuildingType == "Barracks" || location.BuildingType == "Farm") && string.IsNullOrWhiteSpace(location.BuildingStatus)
? "Built"
: revealDetails ? location.BuildingStatus : null,
BuildingStartedAtUtc = revealDetails ? location.BuildingStartedAtUtc : null,
@@ -74,7 +74,7 @@ public class LocationResponse
Label = intel.Label,
Level = intel.Level,
BuildingType = intel.BuildingType,
BuildingStatus = (intel.BuildingType == "LogCamp" || intel.BuildingType == "Mine" || intel.BuildingType == "Barracks") && string.IsNullOrWhiteSpace(intel.BuildingStatus)
BuildingStatus = (intel.BuildingType == "LogCamp" || intel.BuildingType == "Mine" || intel.BuildingType == "Barracks" || intel.BuildingType == "Farm") && string.IsNullOrWhiteSpace(intel.BuildingStatus)
? "Built"
: intel.BuildingStatus,
BuildingStartedAtUtc = intel.BuildingStartedAtUtc,
@@ -19,9 +19,13 @@ public class PlayerResources
public int Ore { get; set; }
public int OrePerMinute { get; set; }
public int OreCapacity { get; set; } = 100;
public int Food { get; set; }
public int FoodPerMinute { get; set; }
public int FoodCapacity { get; set; } = 100;
public DateTime LastGoldGeneratedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime LastWoodGeneratedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime LastOreGeneratedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime LastFoodGeneratedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAtUtc { get; set; } = DateTime.UtcNow;
}
@@ -12,9 +12,13 @@ public class PlayerResourcesResponse
public int Ore { get; set; }
public int OrePerMinute { get; set; }
public int OreCapacity { get; set; }
public int Food { get; set; }
public int FoodPerMinute { get; set; }
public int FoodCapacity { get; set; }
public DateTime LastGoldGeneratedAtUtc { get; set; }
public DateTime LastWoodGeneratedAtUtc { get; set; }
public DateTime LastOreGeneratedAtUtc { get; set; }
public DateTime LastFoodGeneratedAtUtc { get; set; }
public DateTime UpdatedAtUtc { get; set; }
public static PlayerResourcesResponse FromResources(PlayerResources resources) => new()
@@ -29,9 +33,13 @@ public class PlayerResourcesResponse
Ore = resources.Ore,
OrePerMinute = resources.OrePerMinute,
OreCapacity = resources.OreCapacity,
Food = resources.Food,
FoodPerMinute = resources.FoodPerMinute,
FoodCapacity = resources.FoodCapacity,
LastGoldGeneratedAtUtc = resources.LastGoldGeneratedAtUtc,
LastWoodGeneratedAtUtc = resources.LastWoodGeneratedAtUtc,
LastOreGeneratedAtUtc = resources.LastOreGeneratedAtUtc,
LastFoodGeneratedAtUtc = resources.LastFoodGeneratedAtUtc,
UpdatedAtUtc = resources.UpdatedAtUtc
};
}