Adding interactable object spawning

This commit is contained in:
2026-03-19 16:35:07 -05:00
parent 932f7be66b
commit 1aefd5ba88
12 changed files with 768 additions and 68 deletions
@@ -0,0 +1,8 @@
namespace LocationsApi.Models;
public class InteractLocationObjectRequest
{
public string CharacterId { get; set; } = string.Empty;
public string ObjectId { get; set; } = string.Empty;
}
@@ -0,0 +1,22 @@
namespace LocationsApi.Models;
public class InteractLocationObjectResponse
{
public string LocationId { get; set; } = string.Empty;
public string CharacterId { get; set; } = string.Empty;
public string ObjectId { get; set; } = string.Empty;
public string ObjectType { get; set; } = string.Empty;
public string ItemKey { get; set; } = string.Empty;
public int QuantityGranted { get; set; }
public int RemainingQuantity { get; set; }
public bool Consumed { get; set; }
public string InventoryResponseJson { get; set; } = string.Empty;
}
@@ -18,6 +18,15 @@ public class Location
[BsonElement("resources")]
public List<LocationResource> Resources { get; set; } = [];
[BsonElement("biomeKey")]
public string BiomeKey { get; set; } = string.Empty;
[BsonElement("locationObject")]
public LocationObject? LocationObject { get; set; }
[BsonElement("locationObjectResolved")]
public bool LocationObjectResolved { get; set; }
[BsonElement("createdUtc")]
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
}
@@ -0,0 +1,21 @@
using MongoDB.Bson.Serialization.Attributes;
namespace LocationsApi.Models;
public class LocationObject
{
[BsonElement("id")]
public string Id { get; set; } = Guid.NewGuid().ToString("N");
[BsonElement("objectType")]
public string ObjectType { get; set; } = "gatherable";
[BsonElement("objectKey")]
public string ObjectKey { get; set; } = string.Empty;
[BsonElement("name")]
public string Name { get; set; } = string.Empty;
[BsonElement("state")]
public LocationObjectState State { get; set; } = new();
}
@@ -0,0 +1,15 @@
using MongoDB.Bson.Serialization.Attributes;
namespace LocationsApi.Models;
public class LocationObjectState
{
[BsonElement("itemKey")]
public string ItemKey { get; set; } = string.Empty;
[BsonElement("remainingQuantity")]
public int RemainingQuantity { get; set; }
[BsonElement("gatherQuantity")]
public int GatherQuantity { get; set; } = 1;
}