This repository was archived by the owner on Feb 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
8 changed files
with
125 additions
and
36 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
44 changes: 30 additions & 14 deletions
44
backend/app/Savor22b/GraphTypes/Types/DungeonStateType.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 |
---|---|---|
@@ -1,24 +1,40 @@ | ||
namespace Savor22b.GraphTypes.Types; | ||
|
||
using GraphQL.Types; | ||
using Libplanet.Blockchain; | ||
using Libplanet.Net; | ||
using Libplanet.Store; | ||
using Savor22b.States; | ||
using Savor22b.Model; | ||
|
||
public class DungeonStateType : ObjectGraphType<DungeonState> | ||
public class DungeonStateType : ObjectGraphType<Dungeon> | ||
{ | ||
public DungeonStateType( | ||
BlockChain blockChain, | ||
BlockRenderer blockRenderer, | ||
IStore store, | ||
Swarm? swarm = null | ||
) | ||
public DungeonStateType() | ||
{ | ||
Field<NonNullGraphType<StringGraphType>>( | ||
"name", | ||
description: "던전의 이름입니다.", | ||
resolve: context => context.Source.Name | ||
); | ||
|
||
Field<NonNullGraphType<IntGraphType>>( | ||
"x", | ||
description: "던전이 위치하는 마을의 x 좌표입니다.", | ||
resolve: context => context.Source.X | ||
); | ||
|
||
Field<NonNullGraphType<IntGraphType>>( | ||
"y", | ||
description: "던전이 위치하는 마을의 y 좌표입니다.", | ||
resolve: context => context.Source.Y | ||
); | ||
|
||
Field<NonNullGraphType<IntGraphType>>( | ||
"id", | ||
description: "던전의 유니크 아이디입니다.", | ||
resolve: context => context.Source.ID | ||
); | ||
|
||
Field<NonNullGraphType<IntGraphType>>( | ||
name: "DungeonKeyCount", | ||
description: "The number of dungeon keys the user has.", | ||
resolve: context => context.Source.GetDungeonKeyCount(blockChain.Count) | ||
"villageId", | ||
description: "던전이 위치하는 마을의 id 입니다.", | ||
resolve: context => context.Source.VillageId | ||
); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
backend/app/Savor22b/GraphTypes/Types/UserDungeonStateType.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,24 @@ | ||
namespace Savor22b.GraphTypes.Types; | ||
|
||
using GraphQL.Types; | ||
using Libplanet.Blockchain; | ||
using Libplanet.Net; | ||
using Libplanet.Store; | ||
using Savor22b.States; | ||
|
||
public class UserDungeonStateType : ObjectGraphType<UserDungeonState> | ||
{ | ||
public UserDungeonStateType( | ||
BlockChain blockChain, | ||
BlockRenderer blockRenderer, | ||
IStore store, | ||
Swarm? swarm = null | ||
) | ||
{ | ||
Field<NonNullGraphType<IntGraphType>>( | ||
name: "DungeonKeyCount", | ||
description: "The number of dungeon keys the user has.", | ||
resolve: context => context.Source.GetDungeonKeyCount(blockChain.Count) | ||
); | ||
} | ||
} |
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