예제 #1
0
파일: World.cs 프로젝트: Erlisch/Caliginous
        public void Fillmap()
        {
            for(int i = 0; i < 24; i++) {
                for(int k = 0; k < 24; k++) {
                    map[i, k] = new Ground(new OpenTK.Vector3(k * 50, i * 50, 0), new OpenTK.Vector2(50, 50), System.Drawing.Color.White);
                }
            }
            //testsmap = new WorldSection(map);
            int c = 0;
            int widh;
            int hight;
            for(int i = 0; i < 4; i++) {
                widh = i * 6; // NEED TO BE CHANGED, WILL NOT WORK ON ARRAYS BIGGER THAN 2;
                hight = 0;
                for(int u = 0; u < 4; u++) {
                    Smap[c] = new WorldSection();
                    Smap[c].FillSection(widh, hight, map, "templates/testfile1.txt");
                    c++;
                    hight = hight + 6;
                }
            }

            //Smap[0, 0] = new WorldSection(0, 6, 0, 6, map);
            //Smap[0, 1] = new WorldSection(6, 12, 0, 6, map);
            //Smap[1, 0] = new WorldSection(0, 6, 6, 12, map);
            //Smap[1, 1] = new WorldSection(6, 12, 6, 12, map);
        }
예제 #2
0
        /// <summary>
        /// Configures the virtual world from the radiance.world configuration section.
        /// </summary>
        /// <param name="section">The WorldSection configuration section from the application configuration file.</param>
        internal void ConfigureWorld(WorldSection section)
        {
            this.Name = section.Name;
#if DEBUG
            this.ClientTimeoutMinutes = 5;
#else
            this.ClientTimeoutMinutes = section.ClientTimeoutMinutes;
#endif
            this.DefaultMaxCharacters = section.DefaultMaxCharacters;
            this.EnableMagic          = section.EnableMagic;
            this.EnablePsionics       = section.EnablePsionics;
            this.EnableCommandLogging = section.EnableCommandLogging;
            this.PowerMultiplier      = section.PowerMultiplier;
            this.RealismMultiplier    = section.RealismMultiplier;

            this.Providers = new WorldProviderCollection();
            this.Provider  = ProviderUtil.InstantiateProviders <WorldProvider, WorldProviderCollection>(
                section.Providers,
                section.DefaultProvider,
                this.Providers);
            if (this.Provider == null)
            {
                throw new ConfigurationErrorsException(
                          SR.ConfigDefaultWorldProviderNotFound,
                          section.ElementInformation.Properties["defaultProvider"].Source,
                          section.ElementInformation.Properties["defaultProvider"].LineNumber);
            }

            // Set the name of the world as dictated by the provider.
            this.Provider.WorldName = this.Name;
            this.Provider.World     = this;

            // Load any custom properties or values into the world instance.
            this.Provider.WorldLoaded();

            // Map Manager
            this.Map = Activator.CreateInstance(Type.GetType(section.MapManagerType, true, true), new object[] { this }) as MapManager;
            this.Provider.LoadMaps(this.Map);

            // Load Skills from the provider
            this.Skills = this.Provider.GetSkills();

            // Load Commands from the provider
            this.Commands = this.Provider.GetCommands();

            // Load the terrain from the provider.
            this.Terrain = this.Provider.GetTerrain();
        }
예제 #3
0
    void Update()
    {
        if (!Changing && WallPool.GetDivisor().transform.position.y - PlayerTransform.position.y <= 2)
        {
            Changing = true;
            switch (CurrentSection)
            {
            case WorldSection.EARTH:
                CurrentSection = WorldSection.SKY;
                ChangeSection(WorldSection.SKY);
                WallPool.ChangeSection(WorldSection.SKY);
                break;

            case WorldSection.SKY:
                CurrentSection = WorldSection.EARTH;
                ChangeSection(WorldSection.EARTH);
                WallPool.ChangeSection(WorldSection.EARTH);
                break;
            }
        }
    }
예제 #4
0
 void ChangeSection(WorldSection section)
 {
     LastWallSpawnerPos    = WSpawner.gameObject.transform.position;
     WSpawner.SectionBuilt = false;
 }