Skip to content

Commit

Permalink
add AddItemCount in CreateAvatarManager
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-doobu committed Dec 30, 2024
1 parent f35929f commit 5c26dc2
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ namespace Lib9c.DevExtensions.Manager.Contents
/// </summary>
public static class CreateAvatarManager
{
// TODO: Costume과 Grimoire, Aura에 한해 하드코딩같은 형태로 구현되어 있음. 추후 수정 필요.
private const int AddItemCount = 10;

/// <summary>
/// Create an avatar and world state for testing.
/// </summary>
Expand Down Expand Up @@ -252,17 +255,19 @@ private static void AddItemsForTest(
int tradableMaterialCount,
int foodCount)
{
foreach (var row in costumeItemSheet.OrderedList)
for (var i = 0; i < AddItemCount; ++i)
{
avatarState.inventory.AddItem(ItemFactory.CreateCostume(row, random.GenerateRandomGuid()));
foreach (var row in costumeItemSheet.OrderedList)
{
avatarState.inventory.AddItem(ItemFactory.CreateCostume(row, random.GenerateRandomGuid()));
}
}

foreach (var row in materialItemSheet.OrderedList)
{
avatarState.inventory.AddItem(ItemFactory.CreateMaterial(row), materialCount);

if (row.ItemSubType == ItemSubType.Hourglass ||
row.ItemSubType == ItemSubType.ApStone)
if (row.ItemSubType is ItemSubType.Hourglass or ItemSubType.ApStone)

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 270 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.
{
avatarState.inventory.AddItem(ItemFactory.CreateTradableMaterial(row), tradableMaterialCount);
}
Expand All @@ -271,8 +276,14 @@ private static void AddItemsForTest(
foreach (var row in equipmentItemSheet.OrderedList.Where(row =>
row.Id > GameConfig.DefaultAvatarWeaponId))
{
var itemId = random.GenerateRandomGuid();
avatarState.inventory.AddItem(ItemFactory.CreateItemUsable(row, itemId, default));
if (row.ItemSubType is ItemSubType.Grimoire or ItemSubType.Aura)

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-js

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 279 in Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'or pattern' is not available in C# 8.0. Please use language version 9.0 or greater.
{
for (var i = 0; i < AddItemCount; ++i)
{
avatarState.inventory.AddItem(ItemFactory.CreateItemUsable(row, random.GenerateRandomGuid(), default));
}
}
avatarState.inventory.AddItem(ItemFactory.CreateItemUsable(row, random.GenerateRandomGuid(), default));
}

foreach (var row in consumableItemSheet.OrderedList)
Expand Down

0 comments on commit 5c26dc2

Please sign in to comment.