<commit_before>import '../SBURBSim.dart';
import '../navbar.dart';
import 'dart:html';
import 'dart:async';
import '../v2.0/char_creator_helper.dart';

CharCreatorController self;
int initial_seed = 0;
void main()
{
  loadNavbar();
  window.onError.listen((Event event){
    ErrorEvent e = event as ErrorEvent;
    //String msg, String url, lineNo, columnNo, error
    printCorruptionMessage(e);//(e.message, e.path.toString(), e.lineno.toString(), e.colno.toString(), e.toString());
    return;
  });
  new CharCreatorController();
  self = SimController.instance;
  if(getParameterByName("seed",null) != null){
    self.initial_seed = int.parse(getParameterByName("seed",null));
  }else{
    var tmp = getRandomSeed();
    self.initial_seed = tmp;
  }
  querySelector("#button2").onClick.listen((e) => newPlayer());
  querySelector("#button").onClick.listen((e) => renderURLToSendPlayersIntoSBURB());
  SimController.instance.startSession();
  loadFuckingEverything("I really should stop doing this",renderPlayersForEditing );
}

void newPlayer() {
  self.newPlayer();
}

void renderURLToSendPlayersIntoSBURB() {
  self.renderURLToSendPlayersIntoSBURB();
}

void renderPlayersForEditing() {
  self.renderPlayersForEditing();
}
/*
  doesn't do sim stuff, it's overrides are errors, but need it to do a few other things. whatever.
 */
class CharCreatorController extends SimController {
  CharacterCreatorHelper charCreatorHelperGlobalVar;
  int numURLS = 0;

  CharCreatorController() : super() {
    charCreatorHelperGlobalVar = new CharacterCreatorHelper(curSessionGlobalVar.players);
  }

  //don't actually start the session, but get players ready.
  @override
  void easterEggCallBack() {
    initializePlayers(curSessionGlobalVar.players, curSessionGlobalVar);
  }

  void updateRender(){
    for(num i = 0; i<curSessionGlobalVar.players.length; i++){
      var player = curSessionGlobalVar.players[i];
      charCreatorHelperGlobalVar.redrawSinglePlayer(player);
    }
  }



  void renderPlayersForEditing(){
    charCreatorHelperGlobalVar.drawAllPlayers();
    updateRender();
    (querySelector("#button")as ButtonElement).disabled =false;
  }

  void renderURLToSendPlayersIntoSBURB(){
    grabAllPlayerInterests();
    grabCustomChatHandles();
    numURLS ++;
    String html = "<Br><br><a href = 'index2.html?seed=$initial_seed&" + generateURLParamsForPlayers(curSessionGlobalVar.players,true) + "' target='_blank'>Be Responsible For Sending Players into SBURB? (Link $numURLS)</a>";
    appendHtml(querySelector("#character_creator"),html);
  }

  void newPlayer(){
    var p = randomPlayerWithClaspect(curSessionGlobalVar,"Page", "Void");
    curSessionGlobalVar.players.add(p);
    if(curSessionGlobalVar.players.length == 13) window.alert("Like, go ahead and all, but this is your Official Warning that the sim is optimized for no more than 12 player sessions.");
    charCreatorHelperGlobalVar.drawSinglePlayerForHelper(p);

  }

  void grabCustomChatHandleForPlayer(player){
    InputElement e = querySelector("#chatHandle" +player.id);
    player.chatHandle = e.value.replaceAll(new RegExp(r"""<(,?:.|\n)*?>""", multiLine:true), '');
  }



//among other things, having chat handles in plain text right in the url lets people know what to expect.
  void grabCustomChatHandles(){
    for(num i = 0; i<curSessionGlobalVar.players.length; i++){
      grabCustomChatHandleForPlayer(curSessionGlobalVar.players[i]);
    }
  }


  void grabAllPlayerInterests(){
    for(num i = 0; i<curSessionGlobalVar.players.length; i++){
      grabPlayerInterests(curSessionGlobalVar.players[i]);
    }
  }



  void grabPlayerInterests(player){
    InputElement interestCategory1Dom = querySelector("#interestCategory1" +player.id);
    InputElement interestCategory2Dom = querySelector("#interestCategory2" +player.id);
    InputElement interest1TextDom = querySelector("#interest1" +player.id);
    InputElement interest2TextDom = querySelector("#interest2" +player.id);
    player.interest1 = interest1TextDom.value.replaceAll(new RegExp(r"""<(?:.|\n)*?>""", multiLine:true), '');
    player.interest1Category = interestCategory1Dom.value;
    player.interest2 = interest2TextDom.value.replaceAll(new RegExp(r"""<(?:.|,\n)*?>""", multiLine:true), '');
    player.interest2Category = interestCategory2Dom.value;
  }





}<commit_msg>why is spriteCanvas starting with a number???<commit_after>import '../SBURBSim.dart';
import '../navbar.dart';
import 'dart:html';
import 'dart:async';
import '../v2.0/char_creator_helper.dart';

CharCreatorController self;
int initial_seed = 0;
void main()
{
  loadNavbar();
  window.onError.listen((Event event){
    ErrorEvent e = event as ErrorEvent;
    //String msg, String url, lineNo, columnNo, error
    printCorruptionMessage(e);//(e.message, e.path.toString(), e.lineno.toString(), e.colno.toString(), e.toString());
    return;
  });
  new CharCreatorController();
  self = SimController.instance;
  if(getParameterByName("seed",null) != null){
    self.initial_seed = int.parse(getParameterByName("seed",null));
  }else{
    var tmp = getRandomSeed();
    self.initial_seed = tmp;
  }
  querySelector("#button2").onClick.listen((e) => newPlayer());
  querySelector("#button").onClick.listen((e) => renderURLToSendPlayersIntoSBURB());
  SimController.instance.startSession();
  loadFuckingEverything("I really should stop doing this",renderPlayersForEditing );
}

void newPlayer() {
  self.newPlayer();
}

void renderURLToSendPlayersIntoSBURB() {
  self.renderURLToSendPlayersIntoSBURB();
}

void renderPlayersForEditing() {
  self.renderPlayersForEditing();
}
/*
  doesn't do sim stuff, it's overrides are errors, but need it to do a few other things. whatever.
 */
class CharCreatorController extends SimController {
  CharacterCreatorHelper charCreatorHelperGlobalVar;
  int numURLS = 0;

  CharCreatorController() : super() {
  }

  //don't actually start the session, but get players ready.
  @override
  void easterEggCallBack() {
    initializePlayers(curSessionGlobalVar.players, curSessionGlobalVar);
    charCreatorHelperGlobalVar = new CharacterCreatorHelper(curSessionGlobalVar.players);

  }

  void updateRender(){
    for(num i = 0; i<curSessionGlobalVar.players.length; i++){
      var player = curSessionGlobalVar.players[i];
      charCreatorHelperGlobalVar.redrawSinglePlayer(player);
    }
  }



  void renderPlayersForEditing(){
    charCreatorHelperGlobalVar.drawAllPlayers();
    updateRender();
    (querySelector("#button")as ButtonElement).disabled =false;
  }

  void renderURLToSendPlayersIntoSBURB(){
    grabAllPlayerInterests();
    grabCustomChatHandles();
    numURLS ++;
    String html = "<Br><br><a href = 'index2.html?seed=$initial_seed&" + generateURLParamsForPlayers(curSessionGlobalVar.players,true) + "' target='_blank'>Be Responsible For Sending Players into SBURB? (Link $numURLS)</a>";
    appendHtml(querySelector("#character_creator"),html);
  }

  void newPlayer(){
    var p = randomPlayerWithClaspect(curSessionGlobalVar,"Page", "Void");
    curSessionGlobalVar.players.add(p);
    if(curSessionGlobalVar.players.length == 13) window.alert("Like, go ahead and all, but this is your Official Warning that the sim is optimized for no more than 12 player sessions.");
    charCreatorHelperGlobalVar.drawSinglePlayerForHelper(p);

  }

  void grabCustomChatHandleForPlayer(player){
    InputElement e = querySelector("#chatHandle" +player.id);
    player.chatHandle = e.value.replaceAll(new RegExp(r"""<(,?:.|\n)*?>""", multiLine:true), '');
  }



//among other things, having chat handles in plain text right in the url lets people know what to expect.
  void grabCustomChatHandles(){
    for(num i = 0; i<curSessionGlobalVar.players.length; i++){
      grabCustomChatHandleForPlayer(curSessionGlobalVar.players[i]);
    }
  }


  void grabAllPlayerInterests(){
    for(num i = 0; i<curSessionGlobalVar.players.length; i++){
      grabPlayerInterests(curSessionGlobalVar.players[i]);
    }
  }



  void grabPlayerInterests(player){
    InputElement interestCategory1Dom = querySelector("#interestCategory1" +player.id);
    InputElement interestCategory2Dom = querySelector("#interestCategory2" +player.id);
    InputElement interest1TextDom = querySelector("#interest1" +player.id);
    InputElement interest2TextDom = querySelector("#interest2" +player.id);
    player.interest1 = interest1TextDom.value.replaceAll(new RegExp(r"""<(?:.|\n)*?>""", multiLine:true), '');
    player.interest1Category = interestCategory1Dom.value;
    player.interest2 = interest2TextDom.value.replaceAll(new RegExp(r"""<(?:.|,\n)*?>""", multiLine:true), '');
    player.interest2Category = interestCategory2Dom.value;
  }





}
{'fraction_non_alphanumeric': 0.1339685455171622, 'fraction_numerical': 0.006658248191941224, 'mean_word_length': 5.100840336134453, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, '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': '5390017', 'n_tokens_mistral': 2722, 'n_tokens_neox': 2631, 'n_words': 536}