示例#1
0
 public HighlightStructure(UpdateHandler updateHandler, object toHighlight, RgbaColor color)
 {
     this.updateHandler = updateHandler;
     this.toHighlight = toHighlight;
     this.color = color;
     DetermineType();
     InitializeSuffixes();
     stale = true;
     enabled = true;
     updateHandler.AddObserver(this);
 }
示例#2
0
文件: VoiceValue.cs 项目: KSP-KOS/KOS
        public VoiceValue(UpdateHandler updateHandler, int voiceNum, ISoundMaker maker)
        {
            this.voiceNum = voiceNum;
            this.maker = maker;
            this.updateHandler = updateHandler;
            voice = maker.GetVoice(voiceNum);
            maker.SetWave(voiceNum, "square");
            this.updateHandler.AddObserver(this);

            InitalizeSuffixes();
        }
示例#3
0
        public VectorRenderer( UpdateHandler updateHand, SharedObjects shared )
        {
            Vector  = new Vector3d(0,0,0);
            Color   = new RgbaColor(1,1,1);
            Start   = new Vector3d(0,0,0);
            Scale   = 1.0;
            Width   = 0;

            updateHandler = updateHand;
            this.shared = shared;
            InitializeSuffixes();
        }
示例#4
0
        /// <summary>Make all vector renderers invisible everywhere in the kOS module.</summary>
        static public void ClearAll(UpdateHandler handler)
        {
            // Take a copy of the list because the items will be deleted from the update handler
            // as SetShow() gets called, and .NET won't let you iterate over the collection
            // directly while you do that:
            List<VectorRenderer> allOfMe = new List<VectorRenderer>();
            foreach(VectorRenderer item in handler.GetAllUpdatersOfType(typeof(VectorRenderer)))
                allOfMe.Add(item);

            // Now actually turn them all off:
            foreach(VectorRenderer vecRend in allOfMe)
                vecRend.SetShow(false);
        }