Ejemplo n.º 1
0
        public static TRE GetTre(dal.UserData.Hero h)
        {
            TRE it = new TRE()
            {
                id = h.id,
                H  = h.hid,
                L  = CML.ComUtility.XInt(h.hl.ToUpper().Replace("LV", ""), 0),
                R  = CML.ComUtility.XInt(h.hr.ToUpper().Replace("R", ""), 0),
                P  = CML.ComUtility.XInt(h.hp.ToUpper().Replace("+", ""), 0),
            };


            dal.Hero hero = CML.ComUtility.QueryFirst(from x in Bll.webcache.wiki.heroes where x.Id == it.H select x, null);
            if (hero != null)
            {
                it.N = hero.Name;
                it.W = hero.WeaponClassId;
                it.M = hero.MoveTypeId;
            }

            SetTreProp(it.H, it.R, h.var[0], (o => o.HP), ref it.Hp);
            SetTreProp(it.H, it.R, h.var[1], (o => o.ATK), ref it.Atk);
            SetTreProp(it.H, it.R, h.var[2], (o => o.SPD), ref it.Spd);
            SetTreProp(it.H, it.R, h.var[3], (o => o.DEF), ref it.Def);
            SetTreProp(it.H, it.R, h.var[4], (o => o.RES), ref it.Res);

            return(it);
        }
Ejemplo n.º 2
0
        public static List <TRE> GetTreArray(HttpContextBase context)
        {
            dal.UserData user = GetUserData(context);

            List <TRE> tmp = new List <TRE>();

            foreach (dal.UserData.Hero h in user.Team)
            {
                TRE it = GetTre(h);

                tmp.Add(it);
            }

            return(tmp);
        }