Ejemplo n.º 1
0
        public static void ParseJsonBossList()
        {
            string json = File.ReadAllText(Environment.CurrentDirectory + @"\resources\JSON\JsonBossList.json");
            dynamic deserializedItems = JsonConvert.DeserializeObject(json);

            foreach (var jsonBoss in deserializedItems)
            {
                var boss = new Bosses();

                boss.Id = jsonBoss.Name;
                boss.Name = jsonBoss.First["name"];                                     //these five properties (should) exist for every boss
                boss.Text = jsonBoss.First["text"];
                boss.HP = jsonBoss.First["bossHP"]; ;
                boss.Icon = new Bitmap(Environment.CurrentDirectory + @"\resources\images\bosses\" + boss.Id + ".png");

                if (jsonBoss.First["alts1"] != null)
                {
                    boss.Alts1 = jsonBoss.First["alts1"];
                    boss.DetailsString += boss.Alts1 + Environment.NewLine;
                }
                if (jsonBoss.First["alts2"] != null)
                {
                    boss.Alts1 = jsonBoss.First["alts2"];
                    boss.DetailsString += boss.Alts2 + Environment.NewLine;
                }

                boss.NameLogo = new Bitmap(Environment.CurrentDirectory + @"\resources\images\bosses\" + boss.Id + "_2.png");

                Bosses.List.Add(boss);
            }
        }
Ejemplo n.º 2
0
 public ArchivedRun()
 {
     Character = new Characters();
     Items = new List<Items>();
     Floors = new List<Floors>();
     Bosses = new List<Bosses>();
     KilledBy = new Bosses();
 }
Ejemplo n.º 3
0
 public Run()
 {
     RunCharacter = new Characters();
     RunKilledByBoss = new Bosses();
     RunItems = new List<Items>();
     RunFloors = new List<Floors>();
     RunBosses = new List<Bosses>();
 }
Ejemplo n.º 4
0
 public bool AddBoss(Bosses boss)            //check if the played just re-entered the Boss room and the (= boss exists in the list)
 {
     if (!RunBosses.Contains(boss))
     {
         RunBosses.Add(boss);
         return true;
     }
     else
     {
         return false;
     }
 }