﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1.Loader
{
    abstract class ClassLoader
    {
        protected ClassLoader parent;
        public virtual string LoadClass(string name)
        {
            string typ = null;
            if (parent != null)
            {
                typ= parent.LoadClass(name);
            }
            else
            {
                typ = NativeClass.LoadClass(name);
            }
            if (typ == null)
            {
                typ = this.FindClass(name);
                if (typ == null)
                {
                    //throw new Exception("no class");
                    Console.WriteLine("no class");
                }
                return typ;
            }
            else
            {
                return typ;
            }

        }
        public virtual string FindClass(string name)
        {
            return null;
        }
    }
}
