{"size": 1208, "ext": "js", "max_stars_repo_path": "static/scripts/mainPlayerField.js", "max_stars_repo_name": "David-Jianguang-Ran/machinekoro", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "static/scripts/mainPlayerField.js", "max_issues_repo_name": "David-Jianguang-Ran/machinekoro", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "static/scripts/mainPlayerField.js", "max_forks_repo_name": "David-Jianguang-Ran/machinekoro", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.7021276596, "max_line_length": 101, "alphanum_fraction": 0.6084437086}
import React from "react"

import FaceBar from "./faceBar"
import SomePlayerMain from "./somePlayerMain"


class MainPlayerField extends React.Component{
    /*
    this component is a home made carousel
    props:
    - match_state
    - game_state

    children:
    - emoFaceBar
        props:
            displayed_player
            match_state
    - someMainPlayer
        props:
            player = game_state.players[num]
    */
    constructor(props){
        super(props)
        this.state = {
            "displayed_player": 0 // int player_num
        }
        this.setDisplayedPlayerCallback = this.setDisplayedPlayerCallback.bind(this)
    }
    setDisplayedPlayerCallback(player_num){
        this.setState({"displayed_player": player_num})
    }
    render(){
        return(
            <div>
                <FaceBar displayed_player={this.state.displayed_player}
                         match_state={this.props.match_state}
                         setDisplayedPlayerCallback={this.setDisplayedPlayerCallback} />
                <SomePlayerMain player={this.props.game_state.players[this.state.displayed_player]}/>
            </div>
        )
    }
}

export default MainPlayerField

