示例#1
0
        public GameSession()
        {
            CurrentPlayer = new player
            {
                Name      = "xav",
                CharClass = "night",
                Gold      = 10000,
                HP        = 10,
                Lvl       = 1,
                XP        = 0
            };
            // creates a new player object and put that on line 10(playre CurrentPlayer { get; set; }
            // removed unnessacary code, looks cleaner right? :D
            if (!CurrentPlayer.Weapons.Any())
            {
                CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001));
            }

            CurrentWorld = WorldFactory.CreateWorld();

            CurrentLocation = CurrentWorld.LocationAt(0, -1);
        }