add csfloat api usage
This commit is contained in:
@@ -3,6 +3,8 @@ namespace BlueLaminate.Scraper.Skins;
|
||||
/// <summary>A single CS2 skin from the CSGO-API static catalogue (skins.json).</summary>
|
||||
/// <param name="Id">Stable catalogue id, e.g. "skin-e757fd7191f9". Globally unique natural key.</param>
|
||||
/// <param name="WeaponName">Owning weapon, e.g. "AK-47", "Hand Wraps", "Bayonet".</param>
|
||||
/// <param name="DefIndex">CS weapon definition index (weapon.weapon_id), e.g. AK-47=7. Null if absent.</param>
|
||||
/// <param name="PaintIndex">Paint index identifying the finish, e.g. 985. Null if absent.</param>
|
||||
/// <param name="Category">Weapon category, e.g. "Rifles", "Knives", "Gloves". Becomes the weapon type.</param>
|
||||
/// <param name="Team">"CT", "T", or "Both".</param>
|
||||
/// <param name="Name">Skin/pattern name, e.g. "Dragon Lore"; "Vanilla" for knives with no finish.</param>
|
||||
@@ -17,6 +19,8 @@ namespace BlueLaminate.Scraper.Skins;
|
||||
public sealed record CatalogSkin(
|
||||
string Id,
|
||||
string WeaponName,
|
||||
int? DefIndex,
|
||||
int? PaintIndex,
|
||||
string Category,
|
||||
string Team,
|
||||
string Name,
|
||||
|
||||
@@ -48,6 +48,8 @@ public sealed class SkinCatalogClient
|
||||
return new CatalogSkin(
|
||||
Id: dto.Id,
|
||||
WeaponName: dto.Weapon?.Name ?? "Unknown",
|
||||
DefIndex: dto.Weapon?.WeaponId,
|
||||
PaintIndex: dto.PaintIndex,
|
||||
Category: dto.Category?.Name ?? "Unknown",
|
||||
Team: MapTeam(dto.Team?.Id),
|
||||
// Knives with no finish carry a null pattern; "Vanilla" is the community term.
|
||||
@@ -88,9 +90,11 @@ public sealed class SkinCatalogClient
|
||||
string Id,
|
||||
string? Name,
|
||||
string? Description,
|
||||
NamedDto? Weapon,
|
||||
WeaponDto? Weapon,
|
||||
NamedDto? Category,
|
||||
NamedDto? Pattern,
|
||||
// Top-level paint index. AllowReadingFromString handles its string form.
|
||||
int? PaintIndex,
|
||||
decimal? MinFloat,
|
||||
decimal? MaxFloat,
|
||||
NamedDto? Rarity,
|
||||
@@ -102,4 +106,7 @@ public sealed class SkinCatalogClient
|
||||
List<NamedDto>? Crates);
|
||||
|
||||
private sealed record NamedDto(string? Id, string? Name);
|
||||
|
||||
// Weapon carries a numeric weapon_id (the def_index) alongside id/name.
|
||||
private sealed record WeaponDto(string? Id, int? WeaponId, string? Name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user