Skip to content

Instantly share code, notes, and snippets.

@laurencee
Created July 31, 2024 00:38
Show Gist options
  • Select an option

  • Save laurencee/5f3ec2d1cb175473546d15e71c386651 to your computer and use it in GitHub Desktop.

Select an option

Save laurencee/5f3ec2d1cb175473546d15e71c386651 to your computer and use it in GitHub Desktop.
C# DTO dump for ArtifactMMO
using System.ComponentModel.DataAnnotations;
using System.Text.Json;
using System.Text.Json.Serialization;
// ReSharper disable PropertyCanBeMadeInitOnly.Global
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable InconsistentNaming
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
namespace ArtifactsClient.Data;
public class ActionItemBankResponse
{
[JsonPropertyName("data")]
[Required]
public BankItem Data { get; set; } = new();
}
public class Action
{
/// <summary> Character name. </summary>
[JsonPropertyName("character")]
[Required(AllowEmptyStrings = true)]
public string Character { get; set; }
/// <summary> Account character. </summary>
[JsonPropertyName("account")]
[Required(AllowEmptyStrings = true)]
public string Account { get; set; }
/// <summary> Type of action. </summary>
[JsonPropertyName("type")]
[Required(AllowEmptyStrings = true)]
public string Type { get; set; }
/// <summary> Description of action. </summary>
[JsonPropertyName("description")]
[Required(AllowEmptyStrings = true)]
public string Description { get; set; }
/// <summary> Content of action. </summary>
[JsonPropertyName("content")]
[Required]
public object Content { get; set; }
/// <summary> Cooldown in seconds. </summary>
[JsonPropertyName("cooldown")]
public int Cooldown { get; set; }
/// <summary> Datetime of cooldown expiration. </summary>
[JsonPropertyName("cooldown_expiration")]
[Required(AllowEmptyStrings = true)]
public DateTimeOffset Cooldown_expiration { get; set; }
/// <summary> Datetime of creation. </summary>
[JsonPropertyName("created_at")]
[Required(AllowEmptyStrings = true)]
public DateTimeOffset Created_at { get; set; }
}
public class AddAccount
{
/// <summary> Your desired username. </summary>
[JsonPropertyName("username")]
[Required]
[StringLength(32, MinimumLength = 6)]
[RegularExpression(@"^[a-zA-Z0-9_-]+$")]
public string Username { get; set; }
/// <summary> Your password. </summary>
[JsonPropertyName("password")]
[Required]
[StringLength(50, MinimumLength = 5)]
[RegularExpression(@"^[^\s]+$")]
public string Password { get; set; }
/// <summary> Your email. </summary>
[JsonPropertyName("email")]
[Required(AllowEmptyStrings = true)]
public string Email { get; set; }
}
public class AddCharacter
{
/// <summary> Your desired character name. It's unique and all players can see it. </summary>
[JsonPropertyName("name")]
[Required]
[StringLength(12, MinimumLength = 3)]
[RegularExpression(@"^[a-zA-Z0-9_-]+$")]
public string Name { get; set; }
/// <summary> Your desired skin. </summary>
[JsonPropertyName("skin")]
[Required(AllowEmptyStrings = true)]
public AddCharacterSkin Skin { get; set; }
}
public class Announcement
{
/// <summary> Announcement text. </summary>
[JsonPropertyName("message")]
[Required(AllowEmptyStrings = true)]
public string Message { get; set; }
/// <summary> Datetime of the announcement. </summary>
[JsonPropertyName("created_at")]
public DateTimeOffset? Created_at { get; set; }
}
public class BankItem
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Item details. </summary>
[JsonPropertyName("item")]
[Required]
public Item Item { get; set; } = new();
/// <summary> Items in your banks. </summary>
[JsonPropertyName("bank")]
[Required]
public List<SimpleItem> Bank { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class BlockedHits
{
/// <summary> The amount of fire hits blocked. </summary>
[JsonPropertyName("fire")]
public int Fire { get; set; }
/// <summary> The amount of earth hits blocked. </summary>
[JsonPropertyName("earth")]
public int Earth { get; set; }
/// <summary> The amount of water hits blocked. </summary>
[JsonPropertyName("water")]
public int Water { get; set; }
/// <summary> The amount of air hits blocked. </summary>
[JsonPropertyName("air")]
public int Air { get; set; }
/// <summary> The amount of total hits blocked. </summary>
[JsonPropertyName("total")]
public int Total { get; set; }
}
public class ChangePassword
{
/// <summary> Your password. </summary>
[JsonPropertyName("password")]
[Required]
[StringLength(50, MinimumLength = 5)]
[RegularExpression(@"^[^\s]+$")]
public string Password { get; set; }
}
public class CharacterFightData
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Fight details. </summary>
[JsonPropertyName("fight")]
[Required]
public Fight Fight { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class CharacterFightResponse
{
[JsonPropertyName("data")]
[Required]
public CharacterFightData Data { get; set; } = new();
}
public class CharacterMovementData
{
/// <summary> Cooldown details </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Destination details. </summary>
[JsonPropertyName("destination")]
[Required]
public DestinationResponse Destination { get; set; } = new();
/// <summary> Character details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class CharacterMovementResponse
{
[JsonPropertyName("data")]
[Required]
public CharacterMovementData Data { get; set; } = new();
}
public class CharactersResponse
{
[JsonPropertyName("data")]
[Required]
public Character[] Data { get; set; } = [];
}
public class CharacterResponse
{
[JsonPropertyName("data")]
[Required]
public Character Data { get; set; } = new();
}
public class Character
{
/// <summary> Name of the character. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> Character skin code. </summary>
[JsonPropertyName("skin")]
[Required(AllowEmptyStrings = true)]
public CharacterSkin Skin { get; set; }
/// <summary> Combat level. </summary>
[JsonPropertyName("level")]
public int Level { get; set; }
/// <summary> The current xp level of the combat level. </summary>
[JsonPropertyName("xp")]
public int Xp { get; set; }
/// <summary> XP required to level up the character. </summary>
[JsonPropertyName("max_xp")]
public int Max_xp { get; set; }
/// <summary> Total XP of your character. </summary>
[JsonPropertyName("total_xp")]
public int Total_xp { get; set; }
/// <summary> The numbers of golds on this character. </summary>
[JsonPropertyName("gold")]
public int Gold { get; set; }
/// <summary> *Not available, on the roadmap. Character movement speed. </summary>
[JsonPropertyName("speed")]
public int Speed { get; set; }
/// <summary> Mining level. </summary>
[JsonPropertyName("mining_level")]
public int Mining_level { get; set; }
/// <summary> The current xp level of the Mining skill. </summary>
[JsonPropertyName("mining_xp")]
public int Mining_xp { get; set; }
/// <summary> Mining XP required to level up the skill. </summary>
[JsonPropertyName("mining_max_xp")]
public int Mining_max_xp { get; set; }
/// <summary> Woodcutting level. </summary>
[JsonPropertyName("woodcutting_level")]
public int Woodcutting_level { get; set; }
/// <summary> The current xp level of the Woodcutting skill. </summary>
[JsonPropertyName("woodcutting_xp")]
public int Woodcutting_xp { get; set; }
/// <summary> Woodcutting XP required to level up the skill. </summary>
[JsonPropertyName("woodcutting_max_xp")]
public int Woodcutting_max_xp { get; set; }
/// <summary> Fishing level. </summary>
[JsonPropertyName("fishing_level")]
public int Fishing_level { get; set; }
/// <summary> The current xp level of the Fishing skill. </summary>
[JsonPropertyName("fishing_xp")]
public int Fishing_xp { get; set; }
/// <summary> Fishing XP required to level up the skill. </summary>
[JsonPropertyName("fishing_max_xp")]
public int Fishing_max_xp { get; set; }
/// <summary> Weaponcrafting level. </summary>
[JsonPropertyName("weaponcrafting_level")]
public int Weaponcrafting_level { get; set; }
/// <summary> The current xp level of the Weaponcrafting skill. </summary>
[JsonPropertyName("weaponcrafting_xp")]
public int Weaponcrafting_xp { get; set; }
/// <summary> Weaponcrafting XP required to level up the skill. </summary>
[JsonPropertyName("weaponcrafting_max_xp")]
public int Weaponcrafting_max_xp { get; set; }
/// <summary> Gearcrafting level. </summary>
[JsonPropertyName("gearcrafting_level")]
public int Gearcrafting_level { get; set; }
/// <summary> The current xp level of the Gearcrafting skill. </summary>
[JsonPropertyName("gearcrafting_xp")]
public int Gearcrafting_xp { get; set; }
/// <summary> Gearcrafting XP required to level up the skill. </summary>
[JsonPropertyName("gearcrafting_max_xp")]
public int Gearcrafting_max_xp { get; set; }
/// <summary> Jewelrycrafting level. </summary>
[JsonPropertyName("jewelrycrafting_level")]
public int Jewelrycrafting_level { get; set; }
/// <summary> The current xp level of the Jewelrycrafting skill. </summary>
[JsonPropertyName("jewelrycrafting_xp")]
public int Jewelrycrafting_xp { get; set; }
/// <summary> Jewelrycrafting XP required to level up the skill. </summary>
[JsonPropertyName("jewelrycrafting_max_xp")]
public int Jewelrycrafting_max_xp { get; set; }
/// <summary> The current xp level of the Cooking skill. </summary>
[JsonPropertyName("cooking_level")]
public int Cooking_level { get; set; }
/// <summary> Cooking XP. </summary>
[JsonPropertyName("cooking_xp")]
public int Cooking_xp { get; set; }
/// <summary> Cooking XP required to level up the skill. </summary>
[JsonPropertyName("cooking_max_xp")]
public int Cooking_max_xp { get; set; }
/// <summary> Character HP. </summary>
[JsonPropertyName("hp")]
public int Hp { get; set; }
/// <summary> *Character Haste. Increase speed attack (reduce fight cooldown) </summary>
[JsonPropertyName("haste")]
public int Haste { get; set; }
/// <summary> *Not available, on the roadmap. Character Critical Strike. Critical strikes increase the attack's damage. </summary>
[JsonPropertyName("critical_strike")]
public int Critical_strike { get; set; }
/// <summary> *Not available, on the roadmap. Regenerates life at the start of each turn. </summary>
[JsonPropertyName("stamina")]
public int Stamina { get; set; }
/// <summary> Fire attack. </summary>
[JsonPropertyName("attack_fire")]
public int Attack_fire { get; set; }
/// <summary> Earth attack. </summary>
[JsonPropertyName("attack_earth")]
public int Attack_earth { get; set; }
/// <summary> Water attack. </summary>
[JsonPropertyName("attack_water")]
public int Attack_water { get; set; }
/// <summary> Air attack. </summary>
[JsonPropertyName("attack_air")]
public int Attack_air { get; set; }
/// <summary> % Fire damage. </summary>
[JsonPropertyName("dmg_fire")]
public int Dmg_fire { get; set; }
/// <summary> % Earth damage. </summary>
[JsonPropertyName("dmg_earth")]
public int Dmg_earth { get; set; }
/// <summary> % Water damage. </summary>
[JsonPropertyName("dmg_water")]
public int Dmg_water { get; set; }
/// <summary> % Air damage. </summary>
[JsonPropertyName("dmg_air")]
public int Dmg_air { get; set; }
/// <summary> % Fire resistance. </summary>
[JsonPropertyName("res_fire")]
public int Res_fire { get; set; }
/// <summary> % Earth resistance. </summary>
[JsonPropertyName("res_earth")]
public int Res_earth { get; set; }
/// <summary> % Water resistance. </summary>
[JsonPropertyName("res_water")]
public int Res_water { get; set; }
/// <summary> % Air resistance. </summary>
[JsonPropertyName("res_air")]
public int Res_air { get; set; }
/// <summary> Character x coordinate. </summary>
[JsonPropertyName("x")]
public int X { get; set; }
/// <summary> Character y coordinate. </summary>
[JsonPropertyName("y")]
public int Y { get; set; }
/// <summary> Cooldown in seconds. </summary>
/// <remarks> This is still valid in the contract but should not be used by us </remarks>
[JsonPropertyName("cooldown")]
[Obsolete("Use Cooldown_expiration instead, this is the total value from the last action and not updated")]
public int Cooldown { get; set; }
/// <summary> Datetime Cooldown expiration. </summary>
[JsonPropertyName("cooldown_expiration")]
public DateTimeOffset Cooldown_expiration { get; set; }
/// <summary> Weapon slot. </summary>
[JsonPropertyName("weapon_slot")]
[Required(AllowEmptyStrings = true)]
public string Weapon_slot { get; set; }
/// <summary> Shield slot. </summary>
[JsonPropertyName("shield_slot")]
[Required(AllowEmptyStrings = true)]
public string Shield_slot { get; set; }
/// <summary> Helmet slot. </summary>
[JsonPropertyName("helmet_slot")]
[Required(AllowEmptyStrings = true)]
public string Helmet_slot { get; set; }
/// <summary> Body armor slot. </summary>
[JsonPropertyName("body_armor_slot")]
[Required(AllowEmptyStrings = true)]
public string Body_armor_slot { get; set; }
/// <summary> Leg armor slot. </summary>
[JsonPropertyName("leg_armor_slot")]
[Required(AllowEmptyStrings = true)]
public string Leg_armor_slot { get; set; }
/// <summary> Boots slot. </summary>
[JsonPropertyName("boots_slot")]
[Required(AllowEmptyStrings = true)]
public string Boots_slot { get; set; }
/// <summary> Ring 1 slot. </summary>
[JsonPropertyName("ring1_slot")]
[Required(AllowEmptyStrings = true)]
public string Ring1_slot { get; set; }
/// <summary> Ring 2 slot. </summary>
[JsonPropertyName("ring2_slot")]
[Required(AllowEmptyStrings = true)]
public string Ring2_slot { get; set; }
/// <summary> Amulet slot. </summary>
[JsonPropertyName("amulet_slot")]
[Required(AllowEmptyStrings = true)]
public string Amulet_slot { get; set; }
/// <summary> Artifact 1 slot. </summary>
[JsonPropertyName("artifact1_slot")]
[Required(AllowEmptyStrings = true)]
public string Artifact1_slot { get; set; }
/// <summary> Artifact 2 slot. </summary>
[JsonPropertyName("artifact2_slot")]
[Required(AllowEmptyStrings = true)]
public string Artifact2_slot { get; set; }
/// <summary> Artifact 3 slot. </summary>
[JsonPropertyName("artifact3_slot")]
[Required(AllowEmptyStrings = true)]
public string Artifact3_slot { get; set; }
/// <summary> Consumable 1 slot. </summary>
[JsonPropertyName("consumable1_slot")]
[Required(AllowEmptyStrings = true)]
public string Consumable1_slot { get; set; }
/// <summary> Consumable 1 quantity. </summary>
[JsonPropertyName("consumable1_slot_quantity")]
public int Consumable1_slot_quantity { get; set; }
/// <summary> Consumable 2 slot. </summary>
[JsonPropertyName("consumable2_slot")]
[Required(AllowEmptyStrings = true)]
public string Consumable2_slot { get; set; }
/// <summary> Consumable 2 quantity. </summary>
[JsonPropertyName("consumable2_slot_quantity")]
public int Consumable2_slot_quantity { get; set; }
/// <summary> Inventory slot 1. </summary>
[JsonPropertyName("inventory_slot1")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot1 { get; set; }
/// <summary> Inventory 1 quantity. </summary>
[JsonPropertyName("inventory_slot1_quantity")]
public int Inventory_slot1_quantity { get; set; }
/// <summary> Inventory slot 2. </summary>
[JsonPropertyName("inventory_slot2")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot2 { get; set; }
/// <summary> Inventory 2 quantity. </summary>
[JsonPropertyName("inventory_slot2_quantity")]
public int Inventory_slot2_quantity { get; set; }
/// <summary> Inventory slot 3. </summary>
[JsonPropertyName("inventory_slot3")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot3 { get; set; }
/// <summary> Inventory 3 quantity. </summary>
[JsonPropertyName("inventory_slot3_quantity")]
public int Inventory_slot3_quantity { get; set; }
/// <summary> Inventory slot 4. </summary>
[JsonPropertyName("inventory_slot4")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot4 { get; set; }
/// <summary> Inventory 4 quantity. </summary>
[JsonPropertyName("inventory_slot4_quantity")]
public int Inventory_slot4_quantity { get; set; }
/// <summary> Inventory slot 5. </summary>
[JsonPropertyName("inventory_slot5")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot5 { get; set; }
/// <summary> Inventory 5 quantity. </summary>
[JsonPropertyName("inventory_slot5_quantity")]
public int Inventory_slot5_quantity { get; set; }
/// <summary> Inventory slot 6. </summary>
[JsonPropertyName("inventory_slot6")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot6 { get; set; }
/// <summary> Inventory 6 quantity. </summary>
[JsonPropertyName("inventory_slot6_quantity")]
public int Inventory_slot6_quantity { get; set; }
/// <summary> Inventory slot 7. </summary>
[JsonPropertyName("inventory_slot7")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot7 { get; set; }
/// <summary> Inventory 7 quantity. </summary>
[JsonPropertyName("inventory_slot7_quantity")]
public int Inventory_slot7_quantity { get; set; }
/// <summary> Inventory slot 8. </summary>
[JsonPropertyName("inventory_slot8")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot8 { get; set; }
/// <summary> Inventory 8 quantity. </summary>
[JsonPropertyName("inventory_slot8_quantity")]
public int Inventory_slot8_quantity { get; set; }
/// <summary> Inventory slot 9. </summary>
[JsonPropertyName("inventory_slot9")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot9 { get; set; }
/// <summary> Inventory 9 quantity. </summary>
[JsonPropertyName("inventory_slot9_quantity")]
public int Inventory_slot9_quantity { get; set; }
/// <summary> Inventory slot 10. </summary>
[JsonPropertyName("inventory_slot10")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot10 { get; set; }
/// <summary> Inventory 10 quantity. </summary>
[JsonPropertyName("inventory_slot10_quantity")]
public int Inventory_slot10_quantity { get; set; }
/// <summary> Inventory slot 11. </summary>
[JsonPropertyName("inventory_slot11")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot11 { get; set; }
/// <summary> Inventory 11 quantity. </summary>
[JsonPropertyName("inventory_slot11_quantity")]
public int Inventory_slot11_quantity { get; set; }
/// <summary> Inventory slot 12. </summary>
[JsonPropertyName("inventory_slot12")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot12 { get; set; }
/// <summary> Inventory 12 quantity. </summary>
[JsonPropertyName("inventory_slot12_quantity")]
public int Inventory_slot12_quantity { get; set; }
/// <summary> Inventory slot 13. </summary>
[JsonPropertyName("inventory_slot13")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot13 { get; set; }
/// <summary> Inventory 13 quantity. </summary>
[JsonPropertyName("inventory_slot13_quantity")]
public int Inventory_slot13_quantity { get; set; }
/// <summary> Inventory slot 14. </summary>
[JsonPropertyName("inventory_slot14")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot14 { get; set; }
/// <summary> Inventory 14 quantity. </summary>
[JsonPropertyName("inventory_slot14_quantity")]
public int Inventory_slot14_quantity { get; set; }
/// <summary> Inventory slot 15. </summary>
[JsonPropertyName("inventory_slot15")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot15 { get; set; }
/// <summary> Inventory 15 quantity. </summary>
[JsonPropertyName("inventory_slot15_quantity")]
public int Inventory_slot15_quantity { get; set; }
/// <summary> Inventory slot 16. </summary>
[JsonPropertyName("inventory_slot16")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot16 { get; set; }
/// <summary> Inventory 16 quantity. </summary>
[JsonPropertyName("inventory_slot16_quantity")]
public int Inventory_slot16_quantity { get; set; }
/// <summary> Inventory slot 17. </summary>
[JsonPropertyName("inventory_slot17")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot17 { get; set; }
/// <summary> Inventory 17 quantity. </summary>
[JsonPropertyName("inventory_slot17_quantity")]
public int Inventory_slot17_quantity { get; set; }
/// <summary> Inventory slot 18. </summary>
[JsonPropertyName("inventory_slot18")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot18 { get; set; }
/// <summary> Inventory 18 quantity. </summary>
[JsonPropertyName("inventory_slot18_quantity")]
public int Inventory_slot18_quantity { get; set; }
/// <summary> Inventory slot 19. </summary>
[JsonPropertyName("inventory_slot19")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot19 { get; set; }
/// <summary> Inventory 19 quantity. </summary>
[JsonPropertyName("inventory_slot19_quantity")]
public int Inventory_slot19_quantity { get; set; }
/// <summary> Inventory slot 20. </summary>
[JsonPropertyName("inventory_slot20")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot20 { get; set; }
/// <summary> Inventory 20 quantity. </summary>
[JsonPropertyName("inventory_slot20_quantity")]
public int Inventory_slot20_quantity { get; set; }
/// <summary> Inventory max items. </summary>
[JsonPropertyName("inventory_max_items")]
public int Inventory_max_items { get; set; }
/// <summary> Task in progress. </summary>
[JsonPropertyName("task")]
[Required(AllowEmptyStrings = true)]
public string Task { get; set; }
/// <summary> Task type. </summary>
[JsonPropertyName("task_type")]
[Required(AllowEmptyStrings = true)]
public string Task_type { get; set; }
/// <summary> Task progression. </summary>
[JsonPropertyName("task_progress")]
public int Task_progress { get; set; }
/// <summary> Task total objective. </summary>
[JsonPropertyName("task_total")]
public int Task_total { get; set; }
public bool IsAtLocation(Destination destination) => X == destination.X && Y == destination.Y;
public bool HasEquipInSlot(EquipSlot slot, string itemCode)
{
return slot switch
{
EquipSlot.Weapon => Weapon_slot == itemCode,
EquipSlot.Shield => Shield_slot == itemCode,
EquipSlot.Helmet => Helmet_slot == itemCode,
EquipSlot.Body_armor => Body_armor_slot == itemCode,
EquipSlot.Leg_armor => Leg_armor_slot == itemCode,
EquipSlot.Boots => Boots_slot == itemCode,
EquipSlot.Ring1 => Ring1_slot == itemCode,
EquipSlot.Ring2 => Ring2_slot == itemCode,
EquipSlot.Amulet => Amulet_slot == itemCode,
EquipSlot.Artifact => Artifact1_slot == itemCode,
EquipSlot.Artifact2 => Artifact2_slot == itemCode,
EquipSlot.Artifact3 => Artifact3_slot == itemCode,
EquipSlot.Consumable1 => Consumable1_slot == itemCode,
EquipSlot.Consumable2 => Consumable2_slot == itemCode,
_ => throw new ArgumentOutOfRangeException(nameof(slot), slot, null),
};
}
}
public class Cooldown
{
/// <summary> The total seconds of the cooldown. </summary>
[JsonPropertyName("totalSeconds")]
public int TotalSeconds { get; set; }
/// <summary> The remaining seconds of the cooldown. </summary>
[JsonPropertyName("remainingSeconds")]
public int RemainingSeconds { get; set; }
/// <summary> The expiration of the cooldown. </summary>
[JsonPropertyName("expiration")]
[Required(AllowEmptyStrings = true)]
public DateTimeOffset Expiration { get; set; }
/// <summary> The reason of the cooldown. </summary>
[JsonPropertyName("reason")]
[Required(AllowEmptyStrings = true)]
public CooldownReason Reason { get; set; }
}
public class Craft
{
/// <summary> Skill required to craft the item. </summary>
[JsonPropertyName("skill")]
public string Skill { get; set; }
/// <summary> The skill level required to craft the item. </summary>
[JsonPropertyName("level")]
public int Level { get; set; }
/// <summary> List of items required to craft the item. </summary>
[JsonPropertyName("items")]
public List<Item> Items { get; set; }
/// <summary> Quantity of items crafted. </summary>
[JsonPropertyName("quantity")]
public int Quantity { get; set; }
}
public class Crafting
{
/// <summary> Craft code. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
[RegularExpression(@"^[a-zA-Z0-9_-]+$")]
public string Code { get; set; }
/// <summary> Quantity of items to craft. </summary>
[JsonPropertyName("quantity")]
[Range(1, int.MaxValue)]
public int Quantity { get; set; }
}
public class DataPage_Action_
{
[JsonPropertyName("data")]
[Required]
public List<Action> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_Character_
{
[JsonPropertyName("data")]
[Required]
public List<Character> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_Event_
{
[JsonPropertyName("data")]
[Required]
public List<Event> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_GEItem_
{
[JsonPropertyName("data")]
[Required]
public List<GEItem> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_Item_
{
[JsonPropertyName("data")]
[Required]
public List<Item> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_Map_
{
[JsonPropertyName("data")]
[Required]
public List<Map> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_Monster_
{
[JsonPropertyName("data")]
[Required]
public List<Monster> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_MyCharacter_
{
[JsonPropertyName("data")]
[Required]
public List<MyCharacter> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_Resource_
{
[JsonPropertyName("data")]
[Required]
public List<Resource> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DataPage_SimpleItem_
{
[JsonPropertyName("data")]
[Required]
public List<SimpleItem> Data { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("pages")]
public int Pages { get; set; }
}
public class DeleteItemResponse
{
[JsonPropertyName("data")]
[Required]
public DeleteItem Data { get; set; } = new();
}
public class DeleteItem
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Item details. </summary>
[JsonPropertyName("item")]
[Required]
public SimpleItem Item { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class DepositWithdrawGold
{
/// <summary> Quantity of gold. </summary>
[JsonPropertyName("quantity")]
[Range(1, int.MaxValue)]
public int Quantity { get; set; }
}
public class DestinationResponse
{
/// <summary> The name of the destination. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> The x coordinate of the destination. </summary>
[JsonPropertyName("x")]
public int X { get; set; }
/// <summary> The y coordinate of the destination. </summary>
[JsonPropertyName("y")]
public int Y { get; set; }
/// <summary> Content of the destination. </summary>
[JsonPropertyName("content")]
[Required]
public object Content { get; set; }
}
public class Destination
{
public Destination() { }
public Destination(int x, int y)
{
X = x;
Y = y;
}
/// <summary> The x coordinate of the destination. </summary>
[JsonPropertyName("x")]
public int X { get; set; }
/// <summary> The y coordinate of the destination. </summary>
[JsonPropertyName("y")]
public int Y { get; set; }
public override string ToString() => $"({X}, {Y})";
}
public class Drop
{
/// <summary> The code of the item. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
public string Code { get; set; }
/// <summary> The quantity of the item. </summary>
[JsonPropertyName("quantity")]
public int Quantity { get; set; }
public override string ToString() => $"{Quantity}x {Code}";
}
public class EquipRequest
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Item slot. </summary>
[JsonPropertyName("slot")]
[Required(AllowEmptyStrings = true)]
public EquipRequestSlot Slot { get; set; }
/// <summary> Item details. </summary>
[JsonPropertyName("item")]
[Required]
public Item Item { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class Equip
{
/// <summary> Item code. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
[RegularExpression(@"^[a-zA-Z0-9_-]+$")]
public string Code { get; set; }
/// <summary> Item slot. </summary>
[JsonPropertyName("slot")]
[Required(AllowEmptyStrings = true)]
public EquipSlot Slot { get; set; }
}
public class EquipmentResponse
{
[JsonPropertyName("data")]
[Required]
public EquipRequest Data { get; set; } = new();
}
public class Event
{
/// <summary> Name of the event. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> Map of the event. </summary>
[JsonPropertyName("map")]
[Required]
public Map Map { get; set; } = new();
/// <summary> Previous map skin. </summary>
[JsonPropertyName("previous_skin")]
[Required(AllowEmptyStrings = true)]
public string Previous_skin { get; set; }
/// <summary> Duration in minutes. </summary>
[JsonPropertyName("duration")]
public int Duration { get; set; }
/// <summary> Expiration datetime. </summary>
[JsonPropertyName("expiration")]
[Required(AllowEmptyStrings = true)]
public DateTimeOffset Expiration { get; set; }
/// <summary> Start datetime. </summary>
[JsonPropertyName("created_at")]
[Required(AllowEmptyStrings = true)]
public DateTimeOffset Created_at { get; set; }
}
public class Fight
{
/// <summary> The amount of xp gained by the fight. </summary>
[JsonPropertyName("xp")]
public int Xp { get; set; }
/// <summary> The amount of gold gained by the fight. </summary>
[JsonPropertyName("gold")]
public int Gold { get; set; }
/// <summary> The items dropped by the fight. </summary>
[JsonPropertyName("drops")]
[Required]
public List<Drop> Drops { get; set; } = new();
/// <summary> Numbers of the turns of the combat. </summary>
[JsonPropertyName("turns")]
public int Turns { get; set; }
/// <summary> The amount of blocked hits by the monster. </summary>
[JsonPropertyName("monster_blocked_hits")]
[Required]
public BlockedHits Monster_blocked_hits { get; set; } = new();
/// <summary> The amount of blocked hits by the player. </summary>
[JsonPropertyName("player_blocked_hits")]
[Required]
public BlockedHits Player_blocked_hits { get; set; } = new();
/// <summary> The fight logs. </summary>
[JsonPropertyName("logs")]
[Required]
public List<string> Logs { get; set; } = new();
/// <summary> The result of the fight. </summary>
[JsonPropertyName("result")]
[Required(AllowEmptyStrings = true)]
public FightResult Result { get; set; }
}
public class GEItemResponse
{
[JsonPropertyName("data")]
[Required]
public GEItem Data { get; set; } = new();
}
public class GEItem
{
/// <summary> Item code. </summary>
[JsonPropertyName("item")]
[Required(AllowEmptyStrings = true)]
public string Item { get; set; }
/// <summary> Item stock. </summary>
[JsonPropertyName("stock")]
public int Stock { get; set; }
/// <summary> Item value. </summary>
[JsonPropertyName("price")]
public int Price { get; set; }
}
public class GETransactionItem
{
/// <summary> Item code. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
[RegularExpression(@"^[a-zA-Z0-9_-]+$")]
public string Code { get; set; }
/// <summary> Item quantity. </summary>
[JsonPropertyName("quantity")]
[Range(1, 50)]
public int Quantity { get; set; }
/// <summary> Item price. Item price validation protects you if the price has changed since you last checked the buy/sale price of an item. </summary>
[JsonPropertyName("price")]
[Range(1, int.MaxValue)]
public int Price { get; set; }
}
public class GETransactionList
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Transaction details. </summary>
[JsonPropertyName("transaction")]
[Required]
public GETransaction Transaction { get; set; } = new();
/// <summary> Character details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class GETransactionResponse
{
[JsonPropertyName("data")]
[Required]
public GETransactionList Data { get; set; } = new();
}
public class GETransaction
{
/// <summary> Item code. </summary>
[JsonPropertyName("item")]
[Required(AllowEmptyStrings = true)]
public string Item { get; set; }
/// <summary> Item quantity. </summary>
[JsonPropertyName("quantity")]
public int Quantity { get; set; }
/// <summary> Item price. </summary>
[JsonPropertyName("price")]
public int Price { get; set; }
/// <summary> Total price of the transaction. </summary>
[JsonPropertyName("total_price")]
public int Total_price { get; set; }
}
public class GoldBankResponse
{
[JsonPropertyName("data")]
[Required]
public Gold Data { get; set; } = new();
}
public class GoldResponse
{
[JsonPropertyName("data")]
[Required]
public GoldTransaction Data { get; set; } = new();
}
public class Gold
{
/// <summary> Quantity of gold. </summary>
[JsonPropertyName("quantity")]
[Range(0, int.MaxValue)]
public int Quantity { get; set; }
}
public class GoldTransaction
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Bank details. </summary>
[JsonPropertyName("bank")]
[Required]
public Gold Bank { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class HTTPValidationError
{
[JsonPropertyName("detail")]
public List<ValidationError> Detail { get; set; }
}
public class ItemResponse
{
[JsonPropertyName("data")]
[Required]
public SingleItem Data { get; set; } = new();
}
public class Item
{
/// <summary> Item name. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> Item code. This is the item's unique identifier (ID). </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
public string Code { get; set; }
/// <summary> Item level. </summary>
[JsonPropertyName("level")]
[Range(1, int.MaxValue)]
public int Level { get; set; }
/// <summary> Item type. </summary>
[JsonPropertyName("type")]
[Required(AllowEmptyStrings = true)]
public string Type { get; set; }
/// <summary> Item subtype. </summary>
[JsonPropertyName("subtype")]
[Required(AllowEmptyStrings = true)]
public string Subtype { get; set; }
/// <summary> Item description. </summary>
[JsonPropertyName("description")]
[Required(AllowEmptyStrings = true)]
public string Description { get; set; }
/// <summary> List of object effects. For equipment, it will include item stats. </summary>
[JsonPropertyName("effects")]
public List<ItemEffect> Effects { get; set; }
/// <summary> Craft information. If applicable. </summary>
[JsonPropertyName("craft")]
public Craft Craft { get; set; }
}
public class ItemEffect
{
/// <summary> Effect name. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> Effect value. </summary>
[JsonPropertyName("value")]
[Required(AllowEmptyStrings = true)]
public JsonElement Value { get; set; }
}
public class MapResponse
{
[JsonPropertyName("data")]
[Required]
public Map Data { get; set; } = new();
}
public class Map
{
/// <summary> Name of the map. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> Skin of the map. </summary>
[JsonPropertyName("skin")]
[Required(AllowEmptyStrings = true)]
public string Skin { get; set; }
/// <summary> Position X of the map. </summary>
[JsonPropertyName("x")]
public int X { get; set; }
/// <summary> Position Y of the map. </summary>
[JsonPropertyName("y")]
public int Y { get; set; }
/// <summary> Content of the map. </summary>
[JsonPropertyName("content")]
[Required]
public string Content { get; set; }
}
public class MonsterResponse
{
[JsonPropertyName("data")]
[Required]
public Monster Data { get; set; } = new();
}
public class Monster
{
/// <summary> Name of the monster. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> The code of the monster. This is the monster's unique identifier (ID). </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
public string Code { get; set; }
/// <summary> Monster level. </summary>
[JsonPropertyName("level")]
public int Level { get; set; }
/// <summary> Monster hit points. </summary>
[JsonPropertyName("hp")]
public int Hp { get; set; }
/// <summary> Monster fire attack. </summary>
[JsonPropertyName("attack_fire")]
public int Attack_fire { get; set; }
/// <summary> Monster earth attack. </summary>
[JsonPropertyName("attack_earth")]
public int Attack_earth { get; set; }
/// <summary> Monster water attack. </summary>
[JsonPropertyName("attack_water")]
public int Attack_water { get; set; }
/// <summary> Monster air attack. </summary>
[JsonPropertyName("attack_air")]
public int Attack_air { get; set; }
/// <summary> Monster % fire resistance. </summary>
[JsonPropertyName("res_fire")]
public int Res_fire { get; set; }
/// <summary> Monster % earth resistance. </summary>
[JsonPropertyName("res_earth")]
public int Res_earth { get; set; }
/// <summary> Monster % water resistance. </summary>
[JsonPropertyName("res_water")]
public int Res_water { get; set; }
/// <summary> Monster % air resistance. </summary>
[JsonPropertyName("res_air")]
public int Res_air { get; set; }
/// <summary> Monster golds drop. This is a minimum-maximum range (example: 0-5, the player drops between 0 and 5 golds after killing the monster.). </summary>
[JsonPropertyName("golds")]
[Required(AllowEmptyStrings = true)]
public string Golds { get; set; }
/// <summary> Monster drops. This is a list of items that the monster drops after killing the monster. </summary>
[JsonPropertyName("drops")]
[Required]
public List<object> Drops { get; set; } = new();
}
public class MyCharacter
{
/// <summary> Name of the character. </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> Character skin code. </summary>
[JsonPropertyName("skin")]
[Required(AllowEmptyStrings = true)]
public MyCharacterSkin Skin { get; set; }
/// <summary> Combat level. </summary>
[JsonPropertyName("level")]
public int Level { get; set; }
/// <summary> The current xp level of the combat level. </summary>
[JsonPropertyName("xp")]
public int Xp { get; set; }
/// <summary> XP required to level up the character. </summary>
[JsonPropertyName("max_xp")]
public int Max_xp { get; set; }
/// <summary> Total XP of your character. </summary>
[JsonPropertyName("total_xp")]
public int Total_xp { get; set; }
/// <summary> The numbers of golds on this character. </summary>
[JsonPropertyName("gold")]
public int Gold { get; set; }
/// <summary> *Not available, on the roadmap. Character movement speed. </summary>
[JsonPropertyName("speed")]
public int Speed { get; set; }
/// <summary> Mining level. </summary>
[JsonPropertyName("mining_level")]
public int Mining_level { get; set; }
/// <summary> The current xp level of the Mining skill. </summary>
[JsonPropertyName("mining_xp")]
public int Mining_xp { get; set; }
/// <summary> Mining XP required to level up the skill. </summary>
[JsonPropertyName("mining_max_xp")]
public int Mining_max_xp { get; set; }
/// <summary> Woodcutting level. </summary>
[JsonPropertyName("woodcutting_level")]
public int Woodcutting_level { get; set; }
/// <summary> The current xp level of the Woodcutting skill. </summary>
[JsonPropertyName("woodcutting_xp")]
public int Woodcutting_xp { get; set; }
/// <summary> Woodcutting XP required to level up the skill. </summary>
[JsonPropertyName("woodcutting_max_xp")]
public int Woodcutting_max_xp { get; set; }
/// <summary> Fishing level. </summary>
[JsonPropertyName("fishing_level")]
public int Fishing_level { get; set; }
/// <summary> The current xp level of the Fishing skill. </summary>
[JsonPropertyName("fishing_xp")]
public int Fishing_xp { get; set; }
/// <summary> Fishing XP required to level up the skill. </summary>
[JsonPropertyName("fishing_max_xp")]
public int Fishing_max_xp { get; set; }
/// <summary> Weaponcrafting level. </summary>
[JsonPropertyName("weaponcrafting_level")]
public int Weaponcrafting_level { get; set; }
/// <summary> The current xp level of the Weaponcrafting skill. </summary>
[JsonPropertyName("weaponcrafting_xp")]
public int Weaponcrafting_xp { get; set; }
/// <summary> Weaponcrafting XP required to level up the skill. </summary>
[JsonPropertyName("weaponcrafting_max_xp")]
public int Weaponcrafting_max_xp { get; set; }
/// <summary> Gearcrafting level. </summary>
[JsonPropertyName("gearcrafting_level")]
public int Gearcrafting_level { get; set; }
/// <summary> The current xp level of the Gearcrafting skill. </summary>
[JsonPropertyName("gearcrafting_xp")]
public int Gearcrafting_xp { get; set; }
/// <summary> Gearcrafting XP required to level up the skill. </summary>
[JsonPropertyName("gearcrafting_max_xp")]
public int Gearcrafting_max_xp { get; set; }
/// <summary> Jewelrycrafting level. </summary>
[JsonPropertyName("jewelrycrafting_level")]
public int Jewelrycrafting_level { get; set; }
/// <summary> The current xp level of the Jewelrycrafting skill. </summary>
[JsonPropertyName("jewelrycrafting_xp")]
public int Jewelrycrafting_xp { get; set; }
/// <summary> Jewelrycrafting XP required to level up the skill. </summary>
[JsonPropertyName("jewelrycrafting_max_xp")]
public int Jewelrycrafting_max_xp { get; set; }
/// <summary> The current xp level of the Cooking skill. </summary>
[JsonPropertyName("cooking_level")]
public int Cooking_level { get; set; }
/// <summary> Cooking XP. </summary>
[JsonPropertyName("cooking_xp")]
public int Cooking_xp { get; set; }
/// <summary> Cooking XP required to level up the skill. </summary>
[JsonPropertyName("cooking_max_xp")]
public int Cooking_max_xp { get; set; }
/// <summary> Character HP. </summary>
[JsonPropertyName("hp")]
public int Hp { get; set; }
/// <summary> *Character Haste. Increase speed attack (reduce fight cooldown) </summary>
[JsonPropertyName("haste")]
public int Haste { get; set; }
/// <summary> *Not available, on the roadmap. Character Critical Strike. Critical strikes increase the attack's damage. </summary>
[JsonPropertyName("critical_strike")]
public int Critical_strike { get; set; }
/// <summary> *Not available, on the roadmap. Regenerates life at the start of each turn. </summary>
[JsonPropertyName("stamina")]
public int Stamina { get; set; }
/// <summary> Fire attack. </summary>
[JsonPropertyName("attack_fire")]
public int Attack_fire { get; set; }
/// <summary> Earth attack. </summary>
[JsonPropertyName("attack_earth")]
public int Attack_earth { get; set; }
/// <summary> Water attack. </summary>
[JsonPropertyName("attack_water")]
public int Attack_water { get; set; }
/// <summary> Air attack. </summary>
[JsonPropertyName("attack_air")]
public int Attack_air { get; set; }
/// <summary> % Fire damage. </summary>
[JsonPropertyName("dmg_fire")]
public int Dmg_fire { get; set; }
/// <summary> % Earth damage. </summary>
[JsonPropertyName("dmg_earth")]
public int Dmg_earth { get; set; }
/// <summary> % Water damage. </summary>
[JsonPropertyName("dmg_water")]
public int Dmg_water { get; set; }
/// <summary> % Air damage. </summary>
[JsonPropertyName("dmg_air")]
public int Dmg_air { get; set; }
/// <summary> % Fire resistance. </summary>
[JsonPropertyName("res_fire")]
public int Res_fire { get; set; }
/// <summary> % Earth resistance. </summary>
[JsonPropertyName("res_earth")]
public int Res_earth { get; set; }
/// <summary> % Water resistance. </summary>
[JsonPropertyName("res_water")]
public int Res_water { get; set; }
/// <summary> % Air resistance. </summary>
[JsonPropertyName("res_air")]
public int Res_air { get; set; }
/// <summary> Character x coordinate. </summary>
[JsonPropertyName("x")]
public int X { get; set; }
/// <summary> Character y coordinate. </summary>
[JsonPropertyName("y")]
public int Y { get; set; }
/// <summary> Cooldown in seconds. </summary>
[JsonPropertyName("cooldown")]
public int Cooldown { get; set; }
/// <summary> Datetime Cooldown expiration. </summary>
[JsonPropertyName("cooldown_expiration")]
public DateTimeOffset Cooldown_expiration { get; set; }
/// <summary> Weapon slot. </summary>
[JsonPropertyName("weapon_slot")]
[Required(AllowEmptyStrings = true)]
public string Weapon_slot { get; set; }
/// <summary> Shield slot. </summary>
[JsonPropertyName("shield_slot")]
[Required(AllowEmptyStrings = true)]
public string Shield_slot { get; set; }
/// <summary> Helmet slot. </summary>
[JsonPropertyName("helmet_slot")]
[Required(AllowEmptyStrings = true)]
public string Helmet_slot { get; set; }
/// <summary> Body armor slot. </summary>
[JsonPropertyName("body_armor_slot")]
[Required(AllowEmptyStrings = true)]
public string Body_armor_slot { get; set; }
/// <summary> Leg armor slot. </summary>
[JsonPropertyName("leg_armor_slot")]
[Required(AllowEmptyStrings = true)]
public string Leg_armor_slot { get; set; }
/// <summary> Boots slot. </summary>
[JsonPropertyName("boots_slot")]
[Required(AllowEmptyStrings = true)]
public string Boots_slot { get; set; }
/// <summary> Ring 1 slot. </summary>
[JsonPropertyName("ring1_slot")]
[Required(AllowEmptyStrings = true)]
public string Ring1_slot { get; set; }
/// <summary> Ring 2 slot. </summary>
[JsonPropertyName("ring2_slot")]
[Required(AllowEmptyStrings = true)]
public string Ring2_slot { get; set; }
/// <summary> Amulet slot. </summary>
[JsonPropertyName("amulet_slot")]
[Required(AllowEmptyStrings = true)]
public string Amulet_slot { get; set; }
/// <summary> Artifact 1 slot. </summary>
[JsonPropertyName("artifact1_slot")]
[Required(AllowEmptyStrings = true)]
public string Artifact1_slot { get; set; }
/// <summary> Artifact 2 slot. </summary>
[JsonPropertyName("artifact2_slot")]
[Required(AllowEmptyStrings = true)]
public string Artifact2_slot { get; set; }
/// <summary> Artifact 3 slot. </summary>
[JsonPropertyName("artifact3_slot")]
[Required(AllowEmptyStrings = true)]
public string Artifact3_slot { get; set; }
/// <summary> Consumable 1 slot. </summary>
[JsonPropertyName("consumable1_slot")]
[Required(AllowEmptyStrings = true)]
public string Consumable1_slot { get; set; }
/// <summary> Consumable 1 quantity. </summary>
[JsonPropertyName("consumable1_slot_quantity")]
public int Consumable1_slot_quantity { get; set; }
/// <summary> Consumable 2 slot. </summary>
[JsonPropertyName("consumable2_slot")]
[Required(AllowEmptyStrings = true)]
public string Consumable2_slot { get; set; }
/// <summary> Consumable 2 quantity. </summary>
[JsonPropertyName("consumable2_slot_quantity")]
public int Consumable2_slot_quantity { get; set; }
/// <summary> Inventory slot 1. </summary>
[JsonPropertyName("inventory_slot1")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot1 { get; set; }
/// <summary> Inventory 1 quantity. </summary>
[JsonPropertyName("inventory_slot1_quantity")]
public int Inventory_slot1_quantity { get; set; }
/// <summary> Inventory slot 2. </summary>
[JsonPropertyName("inventory_slot2")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot2 { get; set; }
/// <summary> Inventory 2 quantity. </summary>
[JsonPropertyName("inventory_slot2_quantity")]
public int Inventory_slot2_quantity { get; set; }
/// <summary> Inventory slot 3. </summary>
[JsonPropertyName("inventory_slot3")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot3 { get; set; }
/// <summary> Inventory 3 quantity. </summary>
[JsonPropertyName("inventory_slot3_quantity")]
public int Inventory_slot3_quantity { get; set; }
/// <summary> Inventory slot 4. </summary>
[JsonPropertyName("inventory_slot4")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot4 { get; set; }
/// <summary> Inventory 4 quantity. </summary>
[JsonPropertyName("inventory_slot4_quantity")]
public int Inventory_slot4_quantity { get; set; }
/// <summary> Inventory slot 5. </summary>
[JsonPropertyName("inventory_slot5")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot5 { get; set; }
/// <summary> Inventory 5 quantity. </summary>
[JsonPropertyName("inventory_slot5_quantity")]
public int Inventory_slot5_quantity { get; set; }
/// <summary> Inventory slot 6. </summary>
[JsonPropertyName("inventory_slot6")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot6 { get; set; }
/// <summary> Inventory 6 quantity. </summary>
[JsonPropertyName("inventory_slot6_quantity")]
public int Inventory_slot6_quantity { get; set; }
/// <summary> Inventory slot 7. </summary>
[JsonPropertyName("inventory_slot7")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot7 { get; set; }
/// <summary> Inventory 7 quantity. </summary>
[JsonPropertyName("inventory_slot7_quantity")]
public int Inventory_slot7_quantity { get; set; }
/// <summary> Inventory slot 8. </summary>
[JsonPropertyName("inventory_slot8")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot8 { get; set; }
/// <summary> Inventory 8 quantity. </summary>
[JsonPropertyName("inventory_slot8_quantity")]
public int Inventory_slot8_quantity { get; set; }
/// <summary> Inventory slot 9. </summary>
[JsonPropertyName("inventory_slot9")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot9 { get; set; }
/// <summary> Inventory 9 quantity. </summary>
[JsonPropertyName("inventory_slot9_quantity")]
public int Inventory_slot9_quantity { get; set; }
/// <summary> Inventory slot 10. </summary>
[JsonPropertyName("inventory_slot10")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot10 { get; set; }
/// <summary> Inventory 10 quantity. </summary>
[JsonPropertyName("inventory_slot10_quantity")]
public int Inventory_slot10_quantity { get; set; }
/// <summary> Inventory slot 11. </summary>
[JsonPropertyName("inventory_slot11")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot11 { get; set; }
/// <summary> Inventory 11 quantity. </summary>
[JsonPropertyName("inventory_slot11_quantity")]
public int Inventory_slot11_quantity { get; set; }
/// <summary> Inventory slot 12. </summary>
[JsonPropertyName("inventory_slot12")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot12 { get; set; }
/// <summary> Inventory 12 quantity. </summary>
[JsonPropertyName("inventory_slot12_quantity")]
public int Inventory_slot12_quantity { get; set; }
/// <summary> Inventory slot 13. </summary>
[JsonPropertyName("inventory_slot13")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot13 { get; set; }
/// <summary> Inventory 13 quantity. </summary>
[JsonPropertyName("inventory_slot13_quantity")]
public int Inventory_slot13_quantity { get; set; }
/// <summary> Inventory slot 14. </summary>
[JsonPropertyName("inventory_slot14")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot14 { get; set; }
/// <summary> Inventory 14 quantity. </summary>
[JsonPropertyName("inventory_slot14_quantity")]
public int Inventory_slot14_quantity { get; set; }
/// <summary> Inventory slot 15. </summary>
[JsonPropertyName("inventory_slot15")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot15 { get; set; }
/// <summary> Inventory 15 quantity. </summary>
[JsonPropertyName("inventory_slot15_quantity")]
public int Inventory_slot15_quantity { get; set; }
/// <summary> Inventory slot 16. </summary>
[JsonPropertyName("inventory_slot16")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot16 { get; set; }
/// <summary> Inventory 16 quantity. </summary>
[JsonPropertyName("inventory_slot16_quantity")]
public int Inventory_slot16_quantity { get; set; }
/// <summary> Inventory slot 17. </summary>
[JsonPropertyName("inventory_slot17")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot17 { get; set; }
/// <summary> Inventory 17 quantity. </summary>
[JsonPropertyName("inventory_slot17_quantity")]
public int Inventory_slot17_quantity { get; set; }
/// <summary> Inventory slot 18. </summary>
[JsonPropertyName("inventory_slot18")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot18 { get; set; }
/// <summary> Inventory 18 quantity. </summary>
[JsonPropertyName("inventory_slot18_quantity")]
public int Inventory_slot18_quantity { get; set; }
/// <summary> Inventory slot 19. </summary>
[JsonPropertyName("inventory_slot19")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot19 { get; set; }
/// <summary> Inventory 19 quantity. </summary>
[JsonPropertyName("inventory_slot19_quantity")]
public int Inventory_slot19_quantity { get; set; }
/// <summary> Inventory slot 20. </summary>
[JsonPropertyName("inventory_slot20")]
[Required(AllowEmptyStrings = true)]
public string Inventory_slot20 { get; set; }
/// <summary> Inventory 20 quantity. </summary>
[JsonPropertyName("inventory_slot20_quantity")]
public int Inventory_slot20_quantity { get; set; }
/// <summary> Inventory max items. </summary>
[JsonPropertyName("inventory_max_items")]
public int Inventory_max_items { get; set; }
/// <summary> Task in progress. </summary>
[JsonPropertyName("task")]
[Required(AllowEmptyStrings = true)]
public string Task { get; set; }
/// <summary> Task type. </summary>
[JsonPropertyName("task_type")]
[Required(AllowEmptyStrings = true)]
public string Task_type { get; set; }
/// <summary> Task progression. </summary>
[JsonPropertyName("task_progress")]
public int Task_progress { get; set; }
/// <summary> Task total objective. </summary>
[JsonPropertyName("task_total")]
public int Task_total { get; set; }
/// <summary> Account name. Only included on your own characters. </summary>
[JsonPropertyName("account")]
[Required(AllowEmptyStrings = true)]
public string Account { get; set; }
}
public class RecyclingData
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Craft details. </summary>
[JsonPropertyName("details")]
[Required]
public RecyclingItems Details { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class RecyclingItems
{
/// <summary> Objects received. </summary>
[JsonPropertyName("items")]
[Required]
public List<Drop> Items { get; set; } = new();
}
public class Recycling
{
/// <summary> Item code. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
[RegularExpression(@"^[a-zA-Z0-9_-]+$")]
public string Code { get; set; }
/// <summary> Quantity of items to recycle. </summary>
[JsonPropertyName("quantity")]
[Range(1, int.MaxValue)]
public int Quantity { get; set; }
}
public class RecyclingResponse
{
[JsonPropertyName("data")]
[Required]
public RecyclingData Data { get; set; } = new();
}
public class ResourceResponse
{
[JsonPropertyName("data")]
[Required]
public Resource Data { get; set; } = new();
}
public class Resource
{
/// <summary> The name of the resource </summary>
[JsonPropertyName("name")]
[Required(AllowEmptyStrings = true)]
public string Name { get; set; }
/// <summary> The code of the resource. This is the monster's unique identifier (ID). </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
public string Code { get; set; }
/// <summary> The skill required to gather this resource. </summary>
[JsonPropertyName("skill")]
[Required(AllowEmptyStrings = true)]
public ResourceSkill Skill { get; set; }
/// <summary> The skill level required to gather this resource. </summary>
[JsonPropertyName("level")]
public int Level { get; set; }
/// <summary> The drops of this resource. </summary>
[JsonPropertyName("drops")]
[Required]
public List<string> Drops { get; set; } = new();
}
public class Response
{
[JsonPropertyName("message")]
[Required(AllowEmptyStrings = true)]
public string Message { get; set; }
}
public class SimpleItem
{
/// <summary> Item code. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
[RegularExpression(@"^[a-zA-Z0-9_-]+$")]
public string Code { get; set; }
/// <summary> Item quantity. </summary>
[JsonPropertyName("quantity")]
[Range(1, int.MaxValue)]
public int Quantity { get; set; }
}
public class SingleItem
{
/// <summary> Item information. </summary>
[JsonPropertyName("item")]
[Required]
public Item Item { get; set; } = new();
/// <summary> Grand Exchange information. If applicable. </summary>
[JsonPropertyName("ge")]
public string Ge { get; set; }
}
public class SkillData
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Craft details. </summary>
[JsonPropertyName("details")]
[Required]
public SkillInfo Details { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class SkillInfo
{
/// <summary> The amount of xp gained. </summary>
[JsonPropertyName("xp")]
public int Xp { get; set; }
/// <summary> Objects received. </summary>
[JsonPropertyName("items")]
[Required]
public List<Drop> Items { get; set; } = new();
}
public class SkillResponse
{
[JsonPropertyName("data")]
[Required]
public SkillData Data { get; set; } = new();
}
public class StatusResponse
{
[JsonPropertyName("data")]
[Required]
public Status Data { get; set; } = new();
}
public class Status
{
/// <summary> Server status </summary>
[JsonPropertyName("status")]
[Required(AllowEmptyStrings = true)]
public string ServerStatus { get; set; }
/// <summary> Game version. </summary>
[JsonPropertyName("version")]
[Required(AllowEmptyStrings = true)]
public string Version { get; set; }
[JsonPropertyName("characters_online")]
public int Characters_online { get; set; }
[JsonPropertyName("announcements")]
public List<Announcement> Announcements { get; set; }
/// <summary> Last server wipe. </summary>
[JsonPropertyName("last_wipe")]
[Required(AllowEmptyStrings = true)]
public string Last_wipe { get; set; }
/// <summary> Next server wipe. </summary>
[JsonPropertyName("next_wipe")]
[Required(AllowEmptyStrings = true)]
public string Next_wipe { get; set; }
}
public class TaskData
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Task details. </summary>
[JsonPropertyName("task")]
[Required]
public ArtifactTask Task { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class TaskResponse
{
[JsonPropertyName("data")]
[Required]
public TaskData Data { get; set; } = new();
}
public class TaskRewardData
{
/// <summary> Cooldown details. </summary>
[JsonPropertyName("cooldown")]
[Required]
public Cooldown Cooldown { get; set; } = new();
/// <summary> Reward details. </summary>
[JsonPropertyName("reward")]
[Required]
public TaskReward Reward { get; set; } = new();
/// <summary> Player details. </summary>
[JsonPropertyName("character")]
[Required]
public Character Character { get; set; } = new();
}
public class TaskRewardResponse
{
[JsonPropertyName("data")]
[Required]
public TaskRewardData Data { get; set; } = new();
}
public class TaskReward
{
/// <summary> Item code. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
public string Code { get; set; }
/// <summary> Item quantity. </summary>
[JsonPropertyName("quantity")]
public int Quantity { get; set; }
}
public class ArtifactTask // renamed from Task to avoid annoyances with .NET
{
/// <summary> Task objective. </summary>
[JsonPropertyName("code")]
[Required(AllowEmptyStrings = true)]
public string Code { get; set; }
/// <summary> The type of task. </summary>
[JsonPropertyName("type")]
[Required]
public string Type { get; set; }
/// <summary> The total required to complete the task. </summary>
[JsonPropertyName("total")]
public int Total { get; set; }
}
public class TokenResponse
{
[JsonPropertyName("token")]
[Required(AllowEmptyStrings = true)]
public string Token { get; set; }
}
public class Unequip
{
/// <summary> Item slot. </summary>
[JsonPropertyName("slot")]
[Required(AllowEmptyStrings = true)]
public EquipSlot Slot { get; set; }
}
public class ValidationError
{
[JsonPropertyName("loc")]
[Required]
public List<string> Loc { get; set; } = new();
[JsonPropertyName("msg")]
[Required(AllowEmptyStrings = true)]
public string Msg { get; set; }
[JsonPropertyName("type")]
[Required(AllowEmptyStrings = true)]
public string Type { get; set; }
}
/// <summary> Default sort by total XP. </summary>
public enum Sort
{
Woodcutting,
Mining,
Fishing,
Weaponcrafting,
Gearcrafting,
Jewelrycrafting,
Cooking,
}
/// <summary> Type of content on the map. </summary>
public enum Content_type
{
Monster,
Resource,
Workshop,
Bank,
Grand_exchange,
}
/// <summary> Type of items. </summary>
public enum Type
{
Consumable,
Body_armor,
Weapon,
Resource,
Leg_armor,
Helmet,
Boots,
Shield,
Amulet,
Ring,
}
/// <summary> Skill to craft items. </summary>
public enum Craft_skill
{
Weaponcrafting,
Gearcrafting,
Jewelrycrafting,
Cooking,
Woodcutting,
Mining,
}
/// <summary> The code of the skill. </summary>
public enum Skill
{
Mining,
Woodcutting,
Fishing,
}
public enum AddCharacterSkin
{
Men1,
Men2,
Men3,
Women1,
Women2,
Women3,
}
public enum CharacterSkin
{
Men1,
Men2,
Men3,
Women1,
Women2,
Women3,
}
public enum CooldownReason
{
Movement,
Fight,
Crafting,
Gathering,
Buy_ge,
Sell_ge,
Delete_item,
Deposit_bank,
Withdraw_bank,
Equip,
Unequip,
Task,
Recycling,
}
public enum EquipRequestSlot
{
Weapon,
Shield,
Helmet,
Body_armor,
Leg_armor,
Boots,
Ring1,
Ring2,
Amulet,
Artifact1,
Artifact2,
Artifact3,
Consumable1,
Consumable2,
}
public enum EquipSlot
{
Weapon,
Shield,
Helmet,
Body_armor,
Leg_armor,
Boots,
Ring1,
Ring2,
Amulet,
Artifact,
Artifact2,
Artifact3,
Consumable1,
Consumable2,
}
public enum FightResult
{
Win,
Lose,
}
public enum MyCharacterSkin
{
Men1,
Men2,
Men3,
Women1,
Women2,
Women3,
}
public enum ResourceSkill
{
Mining,
Woodcutting,
Fishing,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment