示例#1
0
文件: Bosses.cs 项目: espilioto/TFOI
        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);
            }
        }
示例#2
0
 public ArchivedRun()
 {
     Character = new Characters();
     Items = new List<Items>();
     Floors = new List<Floors>();
     Bosses = new List<Bosses>();
     KilledBy = new Bosses();
 }
示例#3
0
文件: Run.cs 项目: espilioto/TFOI
 public Run()
 {
     RunCharacter = new Characters();
     RunKilledByBoss = new Bosses();
     RunItems = new List<Items>();
     RunFloors = new List<Floors>();
     RunBosses = new List<Bosses>();
 }
示例#4
0
文件: Run.cs 项目: espilioto/TFOI
 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;
     }
 }