$tournament->loadMax('rounds', 'number');
$round = Round::create([
+ 'game' => $tournament->game,
'number' => intval($tournament->rounds_max_number) + 1,
'no_record' => $tournament->no_record,
'tournament_id' => $validatedData['tournament_id'],
];
protected $fillable = [
+ 'game',
'number',
'no_record',
'tournament_id',
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('tournaments', function(Blueprint $table) {
+ $table->string('game')->default('alttpr');
+ });
+ Schema::table('rounds', function(Blueprint $table) {
+ $table->string('game')->default('alttpr');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('tournaments', function(Blueprint $table) {
+ $table->dropColumn('game');
+ });
+ Schema::table('rounds', function(Blueprint $table) {
+ $table->dropColumn('game');
+ });
+ }
+};
<p className="seed">
{round.code ?
<>
- <SeedCode code={round.code} />
+ <SeedCode code={round.code} game={round.game || 'alttpr'} />
<br />
</>
: null}
round: PropTypes.shape({
code: PropTypes.arrayOf(PropTypes.string),
created_at: PropTypes.string,
+ game: PropTypes.string,
locked: PropTypes.bool,
number: PropTypes.number,
seed: PropTypes.string,
import ZeldaIcon from '../common/ZeldaIcon';
-const SeedCode = ({ code }) =>
-<span className="seed-code">
- {code.map((symbol, index) =>
- <ZeldaIcon key={`${symbol}.${index}`} name={symbol} />
+const SeedCode = ({ code, game }) =>
+<span className={`seed-code game-${game}`}>
+ {code.map(game === 'smr'
+ ? (symbol, index) => <span key={`${symbol}.${index}`}>{symbol}</span>
+ : (symbol, index) => <ZeldaIcon key={`${symbol}.${index}`} name={symbol} />
)}
</span>;
SeedCode.propTypes = {
code: PropTypes.arrayOf(PropTypes.string),
+ game: PropTypes.string,
};
export default SeedCode;
}
.seed-code {
- display: inline-flex;
- flex-direction: row;
- flex-wrap: nowrap;
align-items: center;
align-content: center;
justify-content: flex-start;
background: $dark;
color: $light;
vertical-align: middle;
+
+ &.game-alttpr {
+ display: inline-flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ }
+
+ &.game-smr {
+ display: inline-grid;
+ grid-template-columns: 1fr 1fr;
+ > span {
+ text-transform: uppercase;
+ }
+ }
}