diff --git a/libraries/chain/include/graphene/chain/protocol/tournament.hpp b/libraries/chain/include/graphene/chain/protocol/tournament.hpp index 2c390fac..6c5299d4 100644 --- a/libraries/chain/include/graphene/chain/protocol/tournament.hpp +++ b/libraries/chain/include/graphene/chain/protocol/tournament.hpp @@ -36,15 +36,6 @@ namespace graphene { namespace chain { - /** - * @brief List of games currently supported on the blockchain - */ - enum game_type - { - rock_paper_scissors, - GAME_TYPE_COUNT - }; - typedef fc::static_variant game_specific_options; /** @@ -52,9 +43,6 @@ namespace graphene { namespace chain { */ struct tournament_options { - /// The type of game in this tournament - uint16_t type_of_game; /* actually a game_type, but that doesn't reflect properly */ - /// If there aren't enough players registered for the tournament before this time, /// the tournament is canceled fc::time_point_sec registration_deadline; @@ -94,6 +82,8 @@ namespace graphene { namespace chain { fc::variant_object meta; /// Parameters that are specific to the type_of_game in this tournament + /// The type stored in this static_variant field determines what type of game is being + /// played, so each different supported game must have a unique game_options data type game_specific_options game_options; void validate() const; @@ -175,11 +165,9 @@ namespace graphene { namespace chain { } } -FC_REFLECT_ENUM( graphene::chain::game_type, (rock_paper_scissors)(GAME_TYPE_COUNT) ) FC_REFLECT_TYPENAME( graphene::chain::game_specific_options ) FC_REFLECT_TYPENAME( graphene::chain::game_specific_moves ) FC_REFLECT( graphene::chain::tournament_options, - (type_of_game) (registration_deadline) (number_of_players) (buy_in) diff --git a/libraries/chain/tournament_evaluator.cpp b/libraries/chain/tournament_evaluator.cpp index 6bb62866..1c26c092 100644 --- a/libraries/chain/tournament_evaluator.cpp +++ b/libraries/chain/tournament_evaluator.cpp @@ -11,8 +11,6 @@ namespace graphene { namespace chain { void_result tournament_create_evaluator::do_evaluate( const tournament_create_operation& op ) { try { database& d = db(); - FC_ASSERT(op.options.type_of_game == rock_paper_scissors, "Unsupported game type ${type}", ("type", op.options.type_of_game)); - FC_ASSERT(op.options.registration_deadline >= d.head_block_time(), "Registration deadline has already passed"); // TODO: make this committee-set diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 0afe527b..2ecc86e7 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -2451,7 +2451,6 @@ public: { asset_object buy_in_asset = get_asset(tournament_obj.options.buy_in.asset_id); ss << fc::variant(tournament_obj.id).as() << " " - << fc::variant(game_type(tournament_obj.options.type_of_game)).as() << " " << buy_in_asset.amount_to_pretty_string(tournament_obj.options.buy_in.amount) << " " << tournament_obj.options.number_of_players << " players\n"; switch (tournament_obj.get_state())