예제 #1
0
        public virtual void Build(bool silent = false)
        {
            if (IsBuilt)
            {
                return;
            }

            foreach (BuildVoxelOrder vox in VoxelOrders)
            {
                ToBuild.AddVoxel(vox.Voxel);
            }

            IsBuilt         = true;
            ToBuild.IsBuilt = true;
            List <Body> components = RoomLibrary.GenerateRoomComponentsTemplate(
                ToBuild.RoomData, ToBuild.Voxels,
                World.ComponentManager, World.ChunkManager.Content, World.ChunkManager.Graphics);

            RoomLibrary.BuildAllComponents(components, ToBuild, World.ParticleManager);
            ToBuild.OnBuilt();

            if (!silent)
            {
                World.MakeAnnouncement(String.Format("{0} was built", ToBuild.ID), null);
                SoundManager.PlaySound(ContentPaths.Audio.Oscar.sfx_gui_positive_generic, 0.15f);
                World.GoalManager.OnGameEvent(new Goals.Events.BuiltRoom(ToBuild.ID));
            }

            foreach (GameComponent fence in WorkObjects)
            {
                fence.Die();
            }
        }
예제 #2
0
        public virtual void Build()
        {
            if (IsBuilt)
            {
                return;
            }

            foreach (BuildVoxelOrder vox in VoxelOrders)
            {
                ToBuild.AddVoxel(vox.Voxel);
            }
            IsBuilt         = true;
            ToBuild.IsBuilt = true;
            RoomLibrary.GenerateRoomComponentsTemplate(ToBuild, Faction.Components, PlayState.ChunkManager.Content, PlayState.ChunkManager.Graphics);
            ToBuild.OnBuilt();

            PlayState.AnnouncementManager.Announce("Built room!", ToBuild.ID + " was built");
        }