Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            SwordManager  sm     = SwordManager.GetManager("Swords.txt");
            List <string> swords = sm.SwordList();

            foreach (string s in swords)
            {
                SwordPrototype sword1 = sm[s];
                SwordPrototype sword2 = sm[s];
                if (sword1 == sword2)
                {
                    Console.WriteLine("same sword");
                }
                else
                {
                    Console.WriteLine("only same type of sword");
                }

                if (sword1.Handle == sword2.Handle)
                {
                    Console.WriteLine("same handle");
                }
                else
                {
                    Console.WriteLine("swords have their own handle");
                }
                Console.WriteLine("");
            }
            Console.ReadKey();
        }
Ejemplo n.º 2
0
 public static SwordManager GetManager(string FileName)
 {
     if (_instance == null)
     {
         _instance = new SwordManager(FileName);
     }
     return(_instance);
 }