この記録データを適切な形に直し、クライアント側へ送るjson文字列とする。
ここにあるjson文字列はなどで可視化すると見やすい。 与条件
データベースが以下のjson文字列で表されるものと等しいデータ構造を持つとする。
code:exampleDataBase.json
"runnersTable":[
{
"id":0,
"JName":"ほげ",
"EName":"Hoge",
"theDateOfRegistered":0,
"theNumberOfPost":1,
"twitterID":"----",
"youtubeID":"----",
"idOfGameSystemRunnerHavePlayed":[
0
],
"theDateOfLastPost":0
},
{
"id":1,
"JName":"ふが",
"EName":"Fuga",
"theDateOfRegistered":0,
"theNumberOfPost":3,
"twitterID":"----",
"youtubeID":"----",
"idOfGameSystemRunnerHavePlayed":[
0
],
"theDateOfLastPost":0
},
{
"id":2,
"JName":"ほげふが",
"EName":"HogeFuga",
"theDateOfRegistered":0,
"theNumberOfPost":100,
"twitterID":"----",
"youtubeID":"----",
"idOfGameSystemRunnerHavePlayed":[
0
],
"theDateOfLastPost":0
}
],
"gameSystemInfo":[
{
"id":0,
"JName":"日本語作品名",
"EName":"Title Of a kirby's game",
"JDescription":"ゲームに関する説明を短く記述",
"EDescription":"Description about the game",
"list":{
"AbilityList":[
{
"id":0,
"JName":"能力0",
"EName":"Ability0"
},
{
"id":1,
"JName":"能力1",
"EName":"Ability1"
},
{
"id":2,
"JName":"能力2",
"EName":"Ability2"
}
],
"TargetList":[
{
"id":0,
"JName":"対象0",
"EName":"Target0"
},
{
"id":1,
"JName":"対象1",
"EName":"Target1"
},
{
"id":2,
"JName":"対象2",
"EName":"Target2"
}
],
"GameModeList":[
{
"id":0,
"JName":"モード0",
"EName":"Mode0"
},
{
"id":1,
"JName":"モード1",
"EName":"Mode1"
},
{
"id":2,
"JName":"モード2",
"EName":"Mode2"
}
],
"GameDifficultyList":[
{
"id":0,
"JName":"難易度0",
"EName":"Difficulty0"
},
{
"id":1,
"JName":"難易度1",
"EName":"Difficulty1"
},
{
"id":2,
"JName":"難易度2",
"EName":"Difficulty2"
}
]
},
"records":[
{
"recordID":0,
"score":128,
"timestamp":0,
"regulation":{
"gameSystemEnvironment":{
"gameDifficultyID":0,
"gameModeID":0,
"gameSystemID":0
},
"abilityIDsOfPlayerCharacters":[
0
],
"targetID":0
},
"runnerID":0,
"tag":[
0,
2
],
"link":[
"---",
"---"
],
"note":"---"
},
{
"recordID":1,
"score":129,
"timestamp":1,
"regulation":{
"gameSystemEnvironment":{
"gameDifficultyID":0,
"gameModeID":0,
"gameSystemID":0
},
"abilityIDsOfPlayerCharacters":[
2
],
"targetID":1
},
"runnerID":0,
"tag":[
0,
2
],
"link":[
"---",
"---"
],
"note":"---"
},
{
"recordID":2,
"score":133,
"timestamp":3,
"regulation":{
"gameSystemEnvironment":{
"gameDifficultyID":0,
"gameModeID":0,
"gameSystemID":0
},
"abilityIDsOfPlayerCharacters":[
1,
2
],
"targetID":1
},
"runnerID":1,
"tag":[
0,
2
],
"link":[
"---",
"---"
],
"note":"---"
},
{
"recordID":3,
"score":131,
"timestamp":4,
"regulation":{
"gameSystemEnvironment":{
"gameDifficultyID":0,
"gameModeID":0,
"gameSystemID":0
},
"abilityIDsOfPlayerCharacters":[
0,
1,
1,
2
],
"targetID":0
},
"runnerID":0,
"tag":[
0,
2
],
"link":[
"---",
"---"
],
"note":"---"
}
]
}
]
}
code:condition.json
{
"gameSystemEnv":{
"gameSystemID":0,
"gameModeID":0,
"gameDifficultyID":0
},
"groupName":"Name",
"groupSubName":"一戦目",
"orderOfRecordArray":"LowerFirst",
"startOfRecordArray":0,
"limitOfRecordArray":10,
"targetIDs":[
1
],
"abilityIDs":[
1,2
],
"ANDORConditionAboutAbilityIDs":"AND",
"runnerIDs":[],
"language":"Japanese"
}
}
記録が取られた作品のIDが0,そのうちモード番号,難易度番号が0,0であり、記録が早い順に、最大10件、計測対象のIDが1であり、使用された能力のIDが1,2のどちらも含む記録を日本語で取り出す。
以下の結果が出力される。
code:result.json
{
"isSuccess":true,
"recordGroups":[
{
"groupName":"Name",
"groupSubName":"一戦目",
"lastPost":3,
"numberOfRecords":1,
"numberOfRunners":1,
"records":[
{
"regulation":{
"gameSystemEnvironment":{
"gameSystemID":0,
"gameModeID":0,
"gameDifficultyID":0,
"gameSystemName":"ほげ",
"gameModeName":"モード0",
"gameDifficultyName":"難易度0"
},
"targetID":1,
"targetName":"対象1",
"abilityIDsOfPlayerCharacters":[
1,
2
],
"abilityNamesOfPlayerCharacters":[
"能力1",
"能力2"
]
},
"score":133,
"runnerID":1,
"recordID":2,
"runnerName":"ふが"
}
]
}
]
}