Exemple #1
0
        //static List<NPC> npcList = new List<NPC>();
        static void Main(string[] args)
        {
            //==================Set up NPC's==================================================
            UsefulMethods odd        = new UsefulMethods();
            XDocument     npcPlayers = XDocument.Load("NPC.xml"); //Load NPC's in

            odd.addNpcToList(npcPlayers);
            NPC n = new NPC();

            n = odd.getRandomNPC();
            Console.WriteLine(n.name);
            //================================================================================
            //=================Set up Player==================================================
            Console.WriteLine("please select a name for your player:");
            string name   = Console.ReadLine();
            Player player = new Player(name);
            //printPlayerStats(player);
            //=================================================================================
            //================Set up weapons===================================================
            //odd.saveWeaponData("Weapons.xml");
            XDocument weaponDoc = XDocument.Load("weapons.xml");

            odd.addWeaponToList(weaponDoc);
            //=================================================================================
            //===================Debug statements for weapons==================================
            // odd.displayWeapons();
            //Console.Clear();
            //int length = odd.weaponList.Count;
            //for (int i = 0; i < length; i++)
            //{
            //    Weapon w = odd.getRandomWeapon();
            //   // Console.WriteLine("random weapon = " + w.name);
            //    player.addItem(w);
            //}
            //player.showInventory();
            //=================================================================================
            //==================Set up missions================================================
            Mission m = new Mission();

            m.Mission_1(odd, player);
            Console.ReadLine();
            //================================================================================
            //================Debug statements for NPC's=======================================
            //odd.displayNpcs();
            //Console.Clear();
            //Console.WriteLine("Random NPC from list");
            //odd.getRandomNPC();
            //===================================================================================
        }
 //static List<NPC> npcList = new List<NPC>();
 static void Main(string[] args)
 {
     //==================Set up NPC's==================================================
     UsefulMethods odd = new UsefulMethods();
     XDocument npcPlayers = XDocument.Load("NPC.xml"); //Load NPC's in
     odd.addNpcToList(npcPlayers);
     NPC n = new NPC();
     n = odd.getRandomNPC();
     Console.WriteLine(n.name);
     //================================================================================
     //=================Set up Player==================================================
     Console.WriteLine("please select a name for your player:");
     string name = Console.ReadLine();
     Player player = new Player(name);
     //printPlayerStats(player);
     //=================================================================================
     //================Set up weapons===================================================
     //odd.saveWeaponData("Weapons.xml");
     XDocument weaponDoc = XDocument.Load("weapons.xml");
     odd.addWeaponToList(weaponDoc);
     //=================================================================================
     //===================Debug statements for weapons==================================
        // odd.displayWeapons();
     //Console.Clear();
     //int length = odd.weaponList.Count;
     //for (int i = 0; i < length; i++)
     //{
     //    Weapon w = odd.getRandomWeapon();
     //   // Console.WriteLine("random weapon = " + w.name);
     //    player.addItem(w);
     //}
     //player.showInventory();
     //=================================================================================
     //==================Set up missions================================================
     Mission m = new Mission();
     m.Mission_1(odd, player);
     Console.ReadLine();
     //================================================================================
     //================Debug statements for NPC's=======================================
     //odd.displayNpcs();
     //Console.Clear();
     //Console.WriteLine("Random NPC from list");
     //odd.getRandomNPC();
     //===================================================================================
 }