Exemplo n.º 1
0
        /// <summary>
        /// Initializes the instance.
        /// </summary>
        protected void InitializeInstance()
        {
            CreateNewWorldInstanceDir();

            var environmentsInfoManager = new EnvironmentsInfoManager();

            Compose(environmentsInfoManager, EnvironmentsInstanceDir);
            Environments = environmentsInfoManager.Environments.AsReadOnly();

            EnvironmentsInfos = new List <EnvironmentInfo>();
            foreach (IEnvironment e in Environments)
            {
                var environmentInfo = new EnvironmentInfo(e);
                CreateEnvironmentDirs(e, EnvironmentsInstanceDir);
                Compose(environmentInfo, GetEnvironmentRenderersInstanceDir(e));
                EnvironmentHelper.SaveAvatar(e, this);
                EnvironmentsInfos.Add(environmentInfo);
            }


            var botsInfoManager = new BotsInfoManager();

            Compose(botsInfoManager, BotsInstanceDir);
            Bots = botsInfoManager.Bots.AsReadOnly();

            BotsInfos = new List <BotInfo>();
            foreach (IBot b in Bots)
            {
                var botInfo = new BotInfo(b);
                CreateBotDirs(b, BotsInstanceDir);
                Compose(botInfo, GetBotAbilitiesInstanceDir(b));
                BotHelper.SaveAvatar(b, this);

                BotsInfos.Add(botInfo);
            }

            Context = new WorldContext();
        }