Esempio n. 1
0
 public Hero(string name, int firepower, Temple temple) : base(name, firepower)
 {
     this.temple = temple;
     currChamber = temple.getChamber(
         GameManager.getRandom().Next(temple.getYChambers()),
         GameManager.getRandom().Next(temple.getXChambers())
         );
 }
Esempio n. 2
0
        public void start()
        {
            try
            {
                var jsonBytes = File.ReadAllBytes("Data/TempleOfWishes/V1/GameData.json");

                using (JsonDocument jsonDoc = JsonDocument.Parse(jsonBytes))
                {
                    JsonElement root = jsonDoc.RootElement;

                    templeOfWishes = new Temple();
                    templeOfWishes.generateChambers(root);
                    templeOfWishes.generateDragons();
                    templeOfWishes.generateItems(root);

                    hero = new Hero("Hero", 5, templeOfWishes);
                }

                logs.Append(hero);
            } catch (Exception e)
            {
            }
        }