<commit_before>import React from 'react';
import BattleScene from './BattleScene';
import JoinGameScene from './JoinGameScene';
import WallMixin from './WallMixin';
import Projectile from './Projectile';

const io = require('socket.io-client/socket.io');
const server = 'http://localhost:8080'; // change for production

class WelcomePage extends React.Component {

  constructor(props) {
    super(props);
    this.roomId = '0';
    this.socket = io.connect(server);
    window.socket = this.socket; // figure out a better way for everyone to have access to this socket
    
    this.socket.on('assignPlayerId', (playerId) => {
      this.setState({ playerId });
      window.playerId = this.state.playerId;
    });

    this.state = {
      scene: 'joinGame',
      characterId: undefined,
      playerId: undefined,
      role: undefined
    };
  }

  changeScene(nextScene, characterId, role) {
    this.setState({
      scene: nextScene,
      characterId,
      role,
    });
  }

  renderScene() {
    if(this.state.scene === 'joinGame') {
      console.log('render join game scene:')
      return (
        <JoinGameScene socket={this.socket} playerId={this.state.playerId}
        enterBattle={this.changeScene.bind(this, 'battleMode')} roomId={this.roomId}/>
      )
    } else if (this.state.scene === 'battleMode') {
      return (
        <BattleScene socket={this.socket} playerId={this.state.playerId}
        role={this.state.role} characterId={this.state.characterId} roomId={this.roomId}/>
      )
    }
  }

  render () {
    return (
      <a-scene id='scene' physics='debug:false'>
        <a-assets>
          <WallMixin height={8}/>
          <Projectile />
        </a-assets><commit_msg>Remove console log<commit_after>import React from 'react';
import BattleScene from './BattleScene';
import JoinGameScene from './JoinGameScene';
import WallMixin from './WallMixin';
import Projectile from './Projectile';

const io = require('socket.io-client/socket.io');
const server = 'http://localhost:8080'; // change for production

class WelcomePage extends React.Component {

  constructor(props) {
    super(props);
    this.roomId = '0';
    this.socket = io.connect(server);
    window.socket = this.socket; // figure out a better way for everyone to have access to this socket
    
    this.socket.on('assignPlayerId', (playerId) => {
      this.setState({ playerId });
      window.playerId = this.state.playerId;
    });

    this.state = {
      scene: 'joinGame',
      characterId: undefined,
      playerId: undefined,
      role: undefined
    };
  }

  changeScene(nextScene, characterId, role) {
    this.setState({
      scene: nextScene,
      characterId,
      role,
    });
  }

  renderScene() {
    if(this.state.scene === 'joinGame') {
      return (
        <JoinGameScene socket={this.socket} playerId={this.state.playerId}
        enterBattle={this.changeScene.bind(this, 'battleMode')} roomId={this.roomId}/>
      )
    } else if (this.state.scene === 'battleMode') {
      return (
        <BattleScene socket={this.socket} playerId={this.state.playerId}
        role={this.state.role} characterId={this.state.characterId} roomId={this.roomId}/>
      )
    }
  }

  render () {
    return (
      <a-scene id='scene' physics='debug:false'>
        <a-assets>
          <WallMixin height={8}/>
          <Projectile />
        </a-assets>
{'fraction_non_alphanumeric': 0.1430260047281324, 'fraction_numerical': 0.0035460992907801418, 'mean_word_length': 2.8205417607223477, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7643335', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1021, 'n_words': 221}