SuperEvilMegacorp / vainglory-assets

Community provided art, schemas, and other assets that make using the Vainglory API easier
https://developer.vainglorygame.com
MIT License
54 stars 40 forks source link

Feature/Bug/Question? : Consistent Match Rosters #303

Closed Skillz4Killz closed 6 years ago

Skillz4Killz commented 6 years ago

In the /matches endpoint the data that is received is mostly split up into 2 rosters in the following format:

matches.match[0].matchRoster[0]
matches.match[0].matchRoster[1]

There are 2 teams in VG. Blue/Red. matchRoster should be consistent with a side. On occasion 0 can represent blue and sometimes red teams.

Can this be adjusted so that these are always consistent with a team side for example: matchRoster[0] can represent Blue team always.

Expected Behaviour

matchRoster[0] should consistently represent the same team.

Current Behaviour

matchRoster[0] and matchRoster[1] are inconsistent with the team they represent.

Possible Solution

matchRoster[0] should always represent Blue team matchRoster[1] should always represent Red team

Steps to Reproduce (for bugs)

  1. pull matches of a player
  2. View matchRosters

Context

console.log(matches.match[0].matchRoster[0].data.attributes.won)
 console.log(matches.match[0].matchRoster[1].data.attributes.won)

This printing true for [0] and false for [1] but player appears to be on Red Team and has won this match

svperfecta commented 6 years ago

Hey guys - I'm not really sure this is a good idea. Array position shouldn't really indicate anything special, rather, a property of the object should indicate what it is.

NOTE: We support rosters.length > 2 anyways, so it would be hard to assign special meaning to position.