-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
1,745 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/Snap.Hutao/Snap.Hutao/Model/Binding/Hutao/ComplexAvatar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using Snap.Hutao.Model.Intrinsic; | ||
using Snap.Hutao.Model.Metadata.Avatar; | ||
using Snap.Hutao.Model.Metadata.Converter; | ||
|
||
namespace Snap.Hutao.Model.Binding.Hutao; | ||
|
||
/// <summary> | ||
/// 角色 | ||
/// </summary> | ||
internal class ComplexAvatar | ||
{ | ||
/// <summary> | ||
/// 构造一个胡桃数据库角色 | ||
/// </summary> | ||
/// <param name="avatar">元数据角色</param> | ||
/// <param name="rate">率</param> | ||
public ComplexAvatar(Avatar avatar, double rate) | ||
{ | ||
Name = avatar.Name; | ||
Icon = AvatarIconConverter.IconNameToUri(avatar.Icon); | ||
Quality = avatar.Quality; | ||
Rate = $"{rate:P3}"; | ||
} | ||
|
||
/// <summary> | ||
/// 名称 | ||
/// </summary> | ||
public string Name { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 图标 | ||
/// </summary> | ||
public Uri Icon { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 星级 | ||
/// </summary> | ||
public ItemQuality Quality { get; set; } | ||
|
||
/// <summary> | ||
/// 比率 | ||
/// </summary> | ||
public string Rate { get; set; } = default!; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/Snap.Hutao/Snap.Hutao/Model/Binding/Hutao/ComplexAvatarCollocation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using Snap.Hutao.Model.Intrinsic; | ||
using Snap.Hutao.Model.Metadata.Avatar; | ||
using Snap.Hutao.Model.Metadata.Converter; | ||
|
||
namespace Snap.Hutao.Model.Binding.Hutao; | ||
|
||
/// <summary> | ||
/// 角色搭配 | ||
/// </summary> | ||
internal class ComplexAvatarCollocation : ComplexAvatar | ||
{ | ||
/// <summary> | ||
/// 构造一个新的角色搭配 | ||
/// </summary> | ||
/// <param name="avatar">角色</param> | ||
/// <param name="rate">比率</param> | ||
public ComplexAvatarCollocation(Avatar avatar) | ||
: base(avatar, 0) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// 角色 | ||
/// </summary> | ||
public List<ComplexAvatar> Avatars { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 武器 | ||
/// </summary> | ||
public List<ComplexWeapon> Weapons { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 圣遗物套装 | ||
/// </summary> | ||
public List<ComplexReliquarySet> ReliquarySets { get; set; } = default!; | ||
} |
29 changes: 29 additions & 0 deletions
29
src/Snap.Hutao/Snap.Hutao/Model/Binding/Hutao/ComplexAvatarConstellationInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using Snap.Hutao.Model.Metadata.Avatar; | ||
|
||
namespace Snap.Hutao.Model.Binding.Hutao; | ||
|
||
/// <summary> | ||
/// 角色命座信息 | ||
/// </summary> | ||
internal class ComplexAvatarConstellationInfo : ComplexAvatar | ||
{ | ||
/// <summary> | ||
/// 构造一个新的角色命座信息 | ||
/// </summary> | ||
/// <param name="avatar">角色</param> | ||
/// <param name="rate">持有率</param> | ||
/// <param name="rates">命座比率</param> | ||
public ComplexAvatarConstellationInfo(Avatar avatar, double rate, IEnumerable<double> rates) | ||
: base(avatar, rate) | ||
{ | ||
Rates = rates.Select(r => $"{r:P3}").ToList(); | ||
} | ||
|
||
/// <summary> | ||
/// 命座比率 | ||
/// </summary> | ||
public List<string> Rates { get; set; } | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Snap.Hutao/Snap.Hutao/Model/Binding/Hutao/ComplexAvatarRank.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Model.Binding.Hutao; | ||
|
||
/// <summary> | ||
/// 角色榜 | ||
/// </summary> | ||
internal class ComplexAvatarRank | ||
{ | ||
/// <summary> | ||
/// 层数 | ||
/// </summary> | ||
public string Floor { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 排行信息 | ||
/// </summary> | ||
public List<ComplexAvatar> Avatars { get; set; } = default!; | ||
} |
66 changes: 66 additions & 0 deletions
66
src/Snap.Hutao/Snap.Hutao/Model/Binding/Hutao/ComplexReliquarySet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using Snap.Hutao.Model.Metadata.Converter; | ||
using Snap.Hutao.Web.Hutao.Model; | ||
using System.Text; | ||
|
||
namespace Snap.Hutao.Model.Binding.Hutao; | ||
|
||
/// <summary> | ||
/// 圣遗物套装 | ||
/// </summary> | ||
internal class ComplexReliquarySet | ||
{ | ||
/// <summary> | ||
/// 构造一个新的胡桃数据库圣遗物套装 | ||
/// </summary> | ||
/// <param name="reliquarySetRate">圣遗物套装率</param> | ||
/// <param name="idReliquarySetMap">圣遗物套装映射</param> | ||
public ComplexReliquarySet(ItemRate<ReliquarySets, double> reliquarySetRate, Dictionary<int, Metadata.Reliquary.ReliquarySet> idReliquarySetMap) | ||
{ | ||
ReliquarySets sets = reliquarySetRate.Item; | ||
|
||
if (sets.Count >= 1) | ||
{ | ||
StringBuilder setStringBuilder = new(); | ||
List<Uri> icons = new(); | ||
foreach (ReliquarySet set in sets) | ||
{ | ||
Metadata.Reliquary.ReliquarySet metaSet = idReliquarySetMap[set.EquipAffixId / 10]; | ||
|
||
if (setStringBuilder.Length != 0) | ||
{ | ||
setStringBuilder.Append(Environment.NewLine); | ||
} | ||
|
||
setStringBuilder.Append(set.Count).Append('×').Append(metaSet.Name); | ||
icons.Add(RelicIconConverter.IconNameToUri(metaSet.Icon)); | ||
} | ||
|
||
Name = setStringBuilder.ToString(); | ||
Icons = icons; | ||
} | ||
else | ||
{ | ||
Name = "无圣遗物"; | ||
} | ||
|
||
Rate = $"{reliquarySetRate.Rate:P3}"; | ||
} | ||
|
||
/// <summary> | ||
/// 名称 | ||
/// </summary> | ||
public string Name { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 图标 | ||
/// </summary> | ||
public List<Uri> Icons { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// 比率 | ||
/// </summary> | ||
public string Rate { get; set; } = default!; | ||
} |
Oops, something went wrong.