Esempio n. 1
0
        public static void Add(Component c)
        {
            Components.Add(c);

            if (c is Properties.ICore)
            {
                (c as Properties.ICore).onFinishedRecieving += new Properties.OnRecievedEventHandler(ComponentsManager_onFinishedRecieving);
            }
            if (c is Properties.ILightEmitting)
            {
                LightEmittingComponents.Add(c as Properties.ILightEmitting);
            }
            if (c is Properties.IMagnetic)
            {
                MagnetComponents.Add(c as Properties.IMagnetic);
            }

            if (Settings.GameState != Settings.GameStates.Stopped)
            {
                c.Start();
            }
        }