X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=tictactoe%2Ftictactoe.jsx;h=ca0bce3fd4985bf8636893cbfeae92ea4235508b;hp=49c6005c38fe395c610502853f1ec69ab28d3438;hb=9848e7d60b7ad9153b5763801382b880535e8cc6;hpb=e92b0500735ed3f70c218cb38ad421483a497d18 diff --git a/tictactoe/tictactoe.jsx b/tictactoe/tictactoe.jsx index 49c6005..ca0bce3 100644 --- a/tictactoe/tictactoe.jsx +++ b/tictactoe/tictactoe.jsx @@ -91,15 +91,52 @@ function GameInfo(props) { ); } +function TeamButton(props) { + return ; +} + +function TeamChoices(props) { + let other_team; + if (props.player.team === "X") + other_team = "O"; + else + other_team = "X"; + + if (props.player.team === "") { + if (props.first_move) { + return null; + } else { + return [ + , + " ", + + ]; + } + } else { + return ; + } +} + function PlayerInfo(props) { if (! props.player.id) return null; + const choices = ; + return (

Players

{props.player.name} {props.player.team ? ` (${props.player.team})` : ""} + {props.first_move ? "" : " "} + {choices} {props.opponents.map(opponent => ( {", "} @@ -332,15 +369,12 @@ class Game extends React.Component { />, ,
- - {" "} -
{status}