artificer/api/schemas/skill_stats.zig

18 lines
505 B
Zig

const std = @import("std");
const json_utils = @import("../json_utils.zig");
const json = std.json;
const SkillStats = @This();
level: i64,
xp: i64,
max_xp: i64,
pub fn parse(object: json.ObjectMap, level: []const u8, xp: []const u8, max_xp: []const u8) !SkillStats {
return SkillStats{
.level = try json_utils.getIntegerRequired(object, level),
.xp = try json_utils.getIntegerRequired(object, xp),
.max_xp = try json_utils.getIntegerRequired(object, max_xp),
};
}