Fixing IDL build issues: Adding getters & setters to TournamentRequest & TeamRequest classes. (#114)

This commit is contained in:
Aditya Toney 2017-03-28 14:37:56 -07:00 коммит произвёл GitHub
Родитель 7ddcdf3457
Коммит f4f21d9611
12 изменённых файлов: 63 добавлений и 78 удалений

Просмотреть файл

@ -320,27 +320,27 @@ public:
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP const string_t& _Organizer_id() const;
_XSAPIIMP const string_t& organizer_id() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP const string_t& _Tournament_id() const;
_XSAPIIMP const string_t& tournament_id() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP uint32_t _Max_items() const;
_XSAPIIMP uint32_t max_items() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP const std::vector<team_state>& _Team_states() const;
_XSAPIIMP const std::vector<team_state>& state_filter() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP team_order_by _Order_by() const;
_XSAPIIMP team_order_by order_by() const;
private:
uint32_t m_maxItems;
@ -577,32 +577,32 @@ public:
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP bool _Filter_results_for_user() const;
_XSAPIIMP bool filter_results_for_user() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP uint32_t _Max_items() const;
_XSAPIIMP uint32_t max_items() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP const std::vector<tournament_state>& _Tournament_states() const;
_XSAPIIMP const std::vector<tournament_state>& state_filter() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP tournament_order_by _Order_by() const;
_XSAPIIMP tournament_order_by order_by() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP tournament_sort_order _Sort_order() const;
_XSAPIIMP tournament_sort_order sort_order() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP const string_t& _Organizer_id() const;
_XSAPIIMP const string_t& organizer_id() const;
private:
tournament_sort_order m_sortOrder;

Просмотреть файл

@ -28,7 +28,6 @@ multiplayer_session_constants::multiplayer_session_constants() :
{
m_sessionCustomConstants = web::json::value::object();
m_measurementServerAddressesJson = web::json::value::object();
m_sessionCloudComputePackageJson = web::json::value::object();
}
multiplayer_session_constants::multiplayer_session_constants(
@ -60,7 +59,6 @@ multiplayer_session_constants::multiplayer_session_constants(
);
m_measurementServerAddressesJson = web::json::value::object();
m_sessionCloudComputePackageJson = web::json::value::object();
}
multiplayer_session_constants::multiplayer_session_constants(
@ -84,7 +82,6 @@ multiplayer_session_constants::multiplayer_session_constants(
{
m_sessionCustomConstants = web::json::value::object();
m_measurementServerAddressesJson = web::json::value::object();
m_sessionCloudComputePackageJson = web::json::value::object();
}
uint32_t

Просмотреть файл

@ -34,6 +34,12 @@ TeamRequest::GetCppObj() const
return m_cppObj;
}
Windows::Foundation::Collections::IVectorView<TeamState>^
TeamRequest::StateFilter::get()
{
return m_teamStates;
}
void
TeamRequest::StateFilter::set(
_In_ Windows::Foundation::Collections::IVectorView<TeamState>^ states

Просмотреть файл

@ -27,7 +27,7 @@ public:
/// The maximum number of items to return.
/// </summary>
/// <param name="maxItems">The maximum number of items to return.</param>
DEFINE_PROP_SET_OBJ(MaxItems, max_items, uint32);
DEFINE_PROP_GETSET_OBJ(MaxItems, max_items, uint32);
/// <summary>
/// Filter results based on the multiple states of the team.
@ -35,6 +35,7 @@ public:
/// <param name="state">The team states to filter on.</param>
property Windows::Foundation::Collections::IVectorView<TeamState>^ StateFilter
{
Windows::Foundation::Collections::IVectorView<TeamState>^ get();
void set(_In_ Windows::Foundation::Collections::IVectorView<TeamState>^ states);
}
@ -42,7 +43,7 @@ public:
/// Filter results based on the order specified.
/// </summary>
/// <param name="orderBy">The field used to order results.</param>
DEFINE_PROP_SET_ENUM_OBJ(OrderBy, order_by, TeamOrderBy, xbox::services::tournaments::team_order_by);
DEFINE_PROP_GETSET_ENUM_OBJ(OrderBy, order_by, TeamOrderBy, xbox::services::tournaments::team_order_by);
internal:
TeamRequest(

Просмотреть файл

@ -32,6 +32,12 @@ TournamentRequest::GetCppObj() const
return m_cppObj;
}
Windows::Foundation::Collections::IVectorView<TournamentState>^
TournamentRequest::StateFilter::get()
{
return m_tournamentStates;
}
void
TournamentRequest::StateFilter::set(
_In_ Windows::Foundation::Collections::IVectorView<TournamentState>^ states

Просмотреть файл

@ -25,30 +25,31 @@ public:
/// <summary>
/// The maximum number of items to return.
/// </summary>
DEFINE_PROP_SET_OBJ(MaxItems, max_items, uint32);
DEFINE_PROP_GETSET_OBJ(MaxItems, max_items, uint32);
/// <summary>
/// Filter results based on the multiple states of the tournament.
/// </summary>
property Windows::Foundation::Collections::IVectorView<TournamentState>^ StateFilter
{
Windows::Foundation::Collections::IVectorView<TournamentState>^ get();
void set(_In_ Windows::Foundation::Collections::IVectorView<TournamentState>^ states);
}
/// <summary>
/// The property used to order results.
/// </summary>
DEFINE_PROP_SET_ENUM_OBJ(OrderBy, order_by, TournamentOrderBy, xbox::services::tournaments::tournament_order_by);
DEFINE_PROP_GETSET_ENUM_OBJ(OrderBy, order_by, TournamentOrderBy, xbox::services::tournaments::tournament_order_by);
/// <summary>
///The order in which to sort the results.
/// </summary>
DEFINE_PROP_SET_ENUM_OBJ(SortOrder, sort_order, TournamentSortOrder, xbox::services::tournaments::tournament_sort_order);
DEFINE_PROP_GETSET_ENUM_OBJ(SortOrder, sort_order, TournamentSortOrder, xbox::services::tournaments::tournament_sort_order);
/// <summary>
/// The organizer of the tournament.
/// </summary>
DEFINE_PROP_SET_STR_OBJ(OrganizerId, organizer_id);
DEFINE_PROP_GETSET_STR_OBJ(OrganizerId, organizer_id);
internal:
TournamentRequest(

Просмотреть файл

@ -21,19 +21,19 @@ team_request::team_request(
}
const string_t&
team_request::_Organizer_id() const
team_request::organizer_id() const
{
return m_organizerId;
}
const string_t&
team_request::_Tournament_id() const
team_request::tournament_id() const
{
return m_tournamentId;
}
uint32_t
team_request::_Max_items() const
team_request::max_items() const
{
return m_maxItems;
}
@ -47,7 +47,7 @@ team_request::set_max_items(
}
const std::vector<team_state>&
team_request::_Team_states() const
team_request::state_filter() const
{
return m_states;
}
@ -61,7 +61,7 @@ team_request::set_state_filter(
}
team_order_by
team_request::_Order_by() const
team_request::order_by() const
{
return m_orderBy;
}

Просмотреть файл

@ -20,13 +20,13 @@ tournament_request::tournament_request(
}
bool
tournament_request::_Filter_results_for_user() const
tournament_request::filter_results_for_user() const
{
return m_filterResultsForUser;
}
uint32_t
tournament_request::_Max_items() const
tournament_request::max_items() const
{
return m_maxItems;
}
@ -40,7 +40,7 @@ tournament_request::set_max_items(
}
const std::vector<tournament_state>&
tournament_request::_Tournament_states() const
tournament_request::state_filter() const
{
return m_states;
}
@ -54,7 +54,7 @@ tournament_request::set_state_filter(
}
tournament_order_by
tournament_request::_Order_by() const
tournament_request::order_by() const
{
return m_orderBy;
}
@ -68,7 +68,7 @@ tournament_request::set_order_by(
}
tournament_sort_order
tournament_request::_Sort_order() const
tournament_request::sort_order() const
{
return m_sortOrder;
}
@ -82,7 +82,7 @@ tournament_request::set_sort_order(
}
const string_t&
tournament_request::_Organizer_id() const
tournament_request::organizer_id() const
{
return m_organizerId;
}

Просмотреть файл

@ -271,20 +271,20 @@ tournament_service::tournament_sub_path_url(
subPathBuilder.append_query(_T("titleId"), m_appConfig->title_id());
subPathBuilder.append_query(_T("teamForMember"), m_userContext->xbox_user_id());
if (request._Filter_results_for_user())
if (request.filter_results_for_user())
{
subPathBuilder.append_query(_T("memberId"), m_userContext->xbox_user_id());
}
if (!request._Organizer_id().empty())
if (!request.organizer_id().empty())
{
subPathBuilder.append_query(_T("organizer"), request._Organizer_id());
subPathBuilder.append_query(_T("organizer"), request.organizer_id());
}
if (request._Tournament_states().size() > 0)
if (request.state_filter().size() > 0)
{
string_t statesArray = L"[";
for (const auto& state : request._Tournament_states())
for (const auto& state : request.state_filter())
{
statesArray += L"\"";
statesArray += convert_tournament_state_to_string(state);
@ -295,19 +295,19 @@ tournament_service::tournament_sub_path_url(
subPathBuilder.append_query(_T("state"), statesArray);
}
if (request._Sort_order() != tournament_sort_order::none)
if (request.sort_order() != tournament_sort_order::none)
{
subPathBuilder.append_query(_T("sortOrder"), convert_tournament_sort_order_to_string(request._Sort_order()));
subPathBuilder.append_query(_T("sortOrder"), convert_tournament_sort_order_to_string(request.sort_order()));
}
if (request._Order_by() != tournament_order_by::none)
if (request.order_by() != tournament_order_by::none)
{
subPathBuilder.append_query(_T("orderBy"), convert_tournament_order_by_to_string(request._Order_by()));
subPathBuilder.append_query(_T("orderBy"), convert_tournament_order_by_to_string(request.order_by()));
}
if (request._Max_items() > 0)
if (request.max_items() > 0)
{
subPathBuilder.append_query(_T("maxItems"), request._Max_items());
subPathBuilder.append_query(_T("maxItems"), request.max_items());
}
return subPathBuilder.to_string();
@ -322,19 +322,19 @@ tournament_service::team_sub_path_url(
web::uri_builder subPathBuilder;
stringstream_t path;
path << _T("/tournaments/") << request._Organizer_id() << _T("/") << request._Tournament_id() << _T("/teams");
path << _T("/tournaments/") << request.organizer_id() << _T("/") << request.tournament_id() << _T("/teams");
subPathBuilder.set_path(path.str());
subPathBuilder.append_query(_T("memberId"), m_userContext->xbox_user_id());
if (request._Max_items() > 0)
if (request.max_items() > 0)
{
subPathBuilder.append_query(_T("maxItems"), request._Max_items());
subPathBuilder.append_query(_T("maxItems"), request.max_items());
}
if (request._Team_states().size() > 0)
if (request.state_filter().size() > 0)
{
string_t statesArray = L"[";
for (const auto& state : request._Team_states())
for (const auto& state : request.state_filter())
{
statesArray += L"\"";
statesArray += convert_team_state_to_string(state);
@ -345,9 +345,9 @@ tournament_service::team_sub_path_url(
subPathBuilder.append_query(_T("state"), statesArray);
}
if (request._Order_by() != team_order_by::none)
if (request.order_by() != team_order_by::none)
{
subPathBuilder.append_query(_T("orderBy"), convert_team_order_by_to_string(request._Order_by()));
subPathBuilder.append_query(_T("orderBy"), convert_team_order_by_to_string(request.order_by()));
}
return subPathBuilder.to_string();

Просмотреть файл

@ -145,15 +145,6 @@
}\
}
#define DEFINE_PROP_SET_STR_OBJ(x, cppX) \
property Platform::String^ x \
{ \
void set(_In_ Platform::String^ value)\
{\
m_cppObj.set_##cppX(value->Data());\
}\
}
#define DEFINE_PTR_PROP_GETSET_STR_OBJ(x, cppX) \
property Platform::String^ x \
{ \
@ -180,15 +171,6 @@
}\
}
#define DEFINE_PROP_SET_OBJ(x, cppX, y) \
property y x \
{ \
void set(_In_ y value)\
{\
m_cppObj.set_##cppX(value);\
}\
}
#define DEFINE_PTR_PROP_GETSET_OBJ(x, cppX, y) \
property y x \
{ \
@ -332,15 +314,6 @@
}\
}
#define DEFINE_PROP_SET_ENUM_OBJ(x, cppX, y, cppY) \
property y x \
{ \
void set(_In_ y value)\
{\
m_cppObj.set_##cppX(((cppY)(value))); \
}\
}
#define DEFINE_PTR_PROP_GETSET_ENUM_OBJ(x, cppX, y, cppY) \
property y x \
{ \

Просмотреть файл

@ -69,7 +69,7 @@
"userAuthorizationStyle": true,
"crossplay": true,
"searchable": true,
"connectionRequiredForActiveMembers": true,
"connectionRequiredForActiveMembers": true
},
"version": 1,
"maxMembersCount": 100,

Просмотреть файл

@ -175,7 +175,8 @@
"previousMatch": {
"endTime": "2017-02-17T20:06:10.1949991Z",
"result": {
"outcome": "Win"
"outcome": "Rank",
"ranking": 2
},
"label" : "Final Match",
"startTime": "2017-02-17T20:06:10.1949991Z",