<commit_before>#!/usr/bin/env python
from origin import OriginData

from project import g_project

class Room(OriginData):

    tag_name = 'room'
    def __init__(self, id, bg, bgm):
        super(Room, self).__init__()
        self.id = id
        self.bg = bg
        self.areas = []
        self.bgm = bgm

    def setName(self, name):
        self.id = name
        g_project.notify()

    @staticmethod
    def create():
        number_of_new_room = 0
        while ("new_room_%d" % number_of_new_room in g_project.data['rooms'].keys()):
            number_of_new_room += 1
        room = Room("new_room_%d" % (number_of_new_room), "", "")
        g_project.data['rooms'][room.id] = room
        g_project.notify()
        return room<commit_msg>in room's static method createadd control to check if there is a start room, if there isn't set start room as the new room<commit_after>#!/usr/bin/env python
from origin import OriginData

from project import g_project

class Room(OriginData):

    tag_name = 'room'
    def __init__(self, id, bg, bgm):
        super(Room, self).__init__()
        self.id = id
        self.bg = bg
        self.areas = []
        self.bgm = bgm

    def setName(self, name):
        self.id = name
        g_project.notify()

    @staticmethod
    def create():
        number_of_new_room = 0
        while ("new_room_%d" % number_of_new_room in g_project.data['rooms'].keys()):
            number_of_new_room += 1
        room = Room("new_room_%d" % (number_of_new_room), "", "")
        g_project.data['rooms'][room.id] = room
        if not g_project.data['world'].start:
            g_project.data['world'].start = room.id
        g_project.notify()
        return room
{'fraction_non_alphanumeric': 0.12053832650672908, 'fraction_numerical': 0.0023405500292568754, 'mean_word_length': 2.399602385685885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '949116', 'n_tokens_mistral': 563, 'n_tokens_neox': 550, 'n_words': 135}