示例#1
0
        static void Main(string[] args)
        {
            Character  player      = new Character("Player1");
            ShopKeeper merchant    = new ShopKeeper();
            Shop       weaponStore = new Shop(player, merchant);

            player.LoadPlayer("Player.txt");
            merchant.LoadMerchant("Shop.txt");
            if (player.GetName == "Player1")
            {
                Console.WriteLine("Name your character before entering the shop.\n");
                player.GetName = Console.ReadLine();
            }
            weaponStore.ShopMenu();
            player.SavePlayer("Player.txt");
            merchant.SaveMerchant("Shop.txt");
            Console.ReadKey();
        }
示例#2
0
 //Constructor for the Shop passes in a player and a shop keeper.
 public Shop(Character player, ShopKeeper merchant)
 {
     _player   = player;
     _merchant = merchant;
 }