Beispiel #1
0
        public void ProfessionTest()
        {
            JsonSerializerOptions options = GetOptions();

            Profession f = ProfessionManager.GetInstance().GetProfessionData(typeof(Fighter)).GetNewInstance();
            Profession w = ProfessionManager.GetInstance().GetProfessionData(typeof(Wizard)).GetNewInstance();
            Profession t = ProfessionManager.GetInstance().GetProfessionData(typeof(Thief)).GetNewInstance();

            string sf = JsonSerializer.Serialize(f, options);
            string sw = JsonSerializer.Serialize(w, options);
            string st = JsonSerializer.Serialize(t, options);

            Profession fo = JsonSerializer.Deserialize <Fighter>(sf, options);
            Profession wo = JsonSerializer.Deserialize <Wizard>(sw, options);
            Profession to = JsonSerializer.Deserialize <Thief>(st, options);

            IList <Profession> p = new List <Profession>();

            p.Add(f);
            p.Add(w);
            p.Add(t);

            string s = JsonSerializer.Serialize(p, options);

            IList <Profession> r = JsonSerializer.Deserialize <IList <Profession> >(s, options);
        }
Beispiel #2
0
        public void CharacterTest()
        {
            Character c = new Character("Josh", 5, ProfessionManager.GetInstance().GetProfessionData(typeof(Fighter)).GetNewInstance(), RaceManager.GetInstance().GetAllRaces()[0]);

            JsonSerializerOptions options = GetOptions();

            string s = JsonSerializer.Serialize(c, options);

            Character c2 = JsonSerializer.Deserialize <Character>(s, options);

            string s2 = JsonSerializer.Serialize(c2, options);

            Assert.AreEqual(true, c.Name == c2.Name && c2.Profession.Name == c.Profession.Name && s == s2);
        }
Beispiel #3
0
 public static void GetStartSkills(int startSkillGrade, Profession profession, out int startPhysicalSkills, out int startMentalSkills, out int startCombinedSkills)
 {
     ProfessionManager.GetInstance().GetProfessionData(profession).GetStartSkills(startSkillGrade, out startPhysicalSkills, out startMentalSkills, out startCombinedSkills);
 }
Beispiel #4
0
 public List <string> GetGuildPositions()
 {
     return(((ThiefData)ProfessionManager.GetInstance().GetProfessionData(this)).GuildPositions);
 }
Beispiel #5
0
        //aktualizuje finty zloděje
        public void UpdateThiefManeuvers(Character character)
        {
            List <ThiefManeuver> ltm = ((ThiefData)ProfessionManager.GetInstance().GetProfessionData(this)).ThiefManeuvers;

            _thiefManeuvers = ltm.Where(x => x.IsValid(character)).ToList();
        }
 public ProfessionTab()
 {
     InitializeComponent();
     professionTabModel = new ProfessionTabModel(ProfessionManager.GetInstance());
     BindingContext     = professionTabModel;
 }