Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implements many serializers for AttachmentActionResult relates and so on #343

Merged
merged 11 commits into from
Sep 27, 2024

Conversation

boscohyun
Copy link
Member

Background

We need to declare how the AttachmentActionResult related types to deserialize from BsonDocument to object of specific type.
And we also need a GraphQL query for CombinationSlotState.

Changes

  • Implements default constructors and apply BsonIgnore attribute to Bencoded properties to all of types in the Lib9c.Models namespace.
  • Implements and register IBsonSerializers of all AttachmentActionResult relates types.
  • Implements and register CombinationSlotStateRepository.
  • Implements "combinationSlot" and "combinationSlots" GraphQL queries.

Examples

query {
  combinationSlots(avatarAddress: "2eB1d62367A2c5BaD07eC137F73B481350D3F497") {
    result {
      itemUsable {
        id
        itemType
        itemSubType
        itemId
        statsMap {
          value {
            value {
              statType
              baseValue
              additionalValue
            }
          }
        }
        skills {
          chance
          power
          referencedStatType
          statPowerRatio
          skillRow {
            id
            skillType
            skillCategory
            skillTargetType
          }
        }
        buffSkills {
          chance
          power
          referencedStatType
          statPowerRatio
          skillRow {
            id
            skillType
            skillCategory
            skillTargetType
          }
        }
      }
      ... on CombinationConsumable5Result {
        id
        gold
      }
    }
  }
}
{
  "data": {
    "combinationSlots": [
      {
        "result": {
          "itemUsable": {
            "id": 10510000,
            "itemType": "EQUIPMENT",
            "itemSubType": "RING",
            "itemId": "b24a16a7-57b8-4b1e-b381-f05eaaf8692f",
            "statsMap": {
              "value": [
                {
                  "value": {
                    "statType": "ATK",
                    "baseValue": 0,
                    "additionalValue": 6
                  }
                },
                {
                  "value": {
                    "statType": "DEF",
                    "baseValue": 8,
                    "additionalValue": 6
                  }
                }
              ]
            },
            "skills": [
              {
                "chance": 8,
                "power": 0,
                "referencedStatType": "NONE",
                "statPowerRatio": 0,
                "skillRow": {
                  "id": 210000,
                  "skillType": "BUFF",
                  "skillCategory": "ATTACK_BUFF",
                  "skillTargetType": "SELF"
                }
              }
            ],
            "buffSkills": []
          },
          "id": "1080021c-3886-4cbe-b577-d249a4879e23",
          "gold": "0"
        }
      },
      {
        "result": {
          "itemUsable": {
            "id": 10120000,
            "itemType": "EQUIPMENT",
            "itemSubType": "WEAPON",
            "itemId": "eb418f6e-07a5-4843-aa30-3a43bf599e2c",
            "statsMap": {
              "value": [
                {
                  "value": {
                    "statType": "ATK",
                    "baseValue": 31,
                    "additionalValue": 16
                  }
                },
                {
                  "value": {
                    "statType": "SPD",
                    "baseValue": 0,
                    "additionalValue": 36
                  }
                }
              ]
            },
            "skills": [
              {
                "chance": 8,
                "power": 0,
                "referencedStatType": "NONE",
                "statPowerRatio": 0,
                "skillRow": {
                  "id": 210000,
                  "skillType": "BUFF",
                  "skillCategory": "ATTACK_BUFF",
                  "skillTargetType": "SELF"
                }
              }
            ],
            "buffSkills": []
          },
          "id": "f13a1fda-871f-4811-a234-56126cc6f469",
          "gold": "0"
        }
      }
    ]
}

@boscohyun boscohyun requested review from moreal, Atralupus and a team September 26, 2024 06:06
@boscohyun boscohyun self-assigned this Sep 26, 2024
@boscohyun boscohyun added this pull request to the merge queue Sep 27, 2024
Merged via the queue into main with commit 8327773 Sep 27, 2024
6 checks passed
@boscohyun boscohyun deleted the fix-serialization branch September 27, 2024 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants