コード例 #1
0
ファイル: VMContext.cs プロジェクト: Ne-Ice/FreeSims
        public virtual void Load(VMContextMarshal input)
        {
            Blueprint    = new Blueprint(input.Architecture.Width, input.Architecture.Height);
            Architecture = new VMArchitecture(input.Architecture, this, Blueprint);
            Clock        = new VMClock(input.Clock);

            if (VM.UseWorld)
            {
                foreach (var active in input.Ambience.ActiveSounds)
                {
                    Ambience.SetAmbience(active, true);
                }

                World.State.WorldSize = input.Architecture.Width;
                Blueprint.Terrain     = new TerrainComponent(new Rectangle(1, 1, input.Architecture.Width - 2, input.Architecture.Height - 2));
                Blueprint.Terrain.Initialize(this.World.State.Device, this.World.State);

                World.InitBlueprint(Blueprint);
            }

            RandomSeed = input.RandomSeed;
        }
コード例 #2
0
ファイル: VMContext.cs プロジェクト: Daribon/FreeSO
        public virtual void Load(VMContextMarshal input)
        {
            Blueprint = new Blueprint(input.Architecture.Width, input.Architecture.Height);
            Architecture = new VMArchitecture(input.Architecture, this, Blueprint);
            Clock = new VMClock(input.Clock);

            if (VM.UseWorld)
            {
                foreach (var active in input.Ambience.ActiveSounds) Ambience.SetAmbience(active, true);

                World.State.WorldSize = input.Architecture.Width;
                Blueprint.Terrain = new TerrainComponent(new Rectangle(1, 1, input.Architecture.Width - 2, input.Architecture.Height - 2));
                Blueprint.Terrain.Initialize(this.World.State.Device, this.World.State);

                World.InitBlueprint(Blueprint);
            }

            RandomSeed = input.RandomSeed;
        }