Exemplo n.º 1
0
        public KernelMain()
        {
            Console.WriteLine("Cosmos booted. Adding components...");
            _components    = new List <IComponent>();
            _reservedWords = new List <string>();

            _components.Add(new CoreComponent());
            FileManagerComponent file = FileManagerComponent.getInstance();

            _components.Add(file);
            _components.Add(new BatchComponent());
            MathComponent math = MathComponent.getInstance();

            _components.Add(math);

            foreach (IComponent component in _components)
            {
                foreach (string word in component.getCommands())
                {
                    _reservedWords.Add(word);
                }
            }

            math.setReservedWords(_reservedWords);

            Console.WriteLine("Components ready. Booting complete.");
        }
Exemplo n.º 2
0
        public static MathComponent getInstance()
        {
            if (_instance == null)
            {
                _instance = new MathComponent();
            }

            return(_instance);
        }