public void onAttackHanle(BaseRole go, int skillid)
        {
            BaseRole temp = go;

            if (!dHurt.ContainsKey(temp))
            {
                return;
            }
            lHurt lHurtD = dHurt[temp];

            if (lHurtD.Count == 0)
            {
                return;
            }
            List <HurtData> list = lHurtD.l;

            for (int i = 0; i < list.Count; i++)
            {
                HurtData d       = list[i];
                bool     needdel = d.play(lHurtD.maxComboNum);
                if (needdel)
                {
                    i--;
                    list.Remove(d);
                }
            }
            //if (lHurtD.Count == 0)
            //    lHurtD.maxComboNum = 0;

            //if (lHurtD.maxComboNum > 0)
            //    lHurtD.maxComboNum--;
        }
Example #2
0
        public void onAttackHanle(BaseRole go, int skillid)
        {
            bool flag = !this.dHurt.ContainsKey(go);

            if (!flag)
            {
                lHurt lHurt = this.dHurt[go];
                bool  flag2 = lHurt.Count == 0;
                if (!flag2)
                {
                    List <HurtData> l = lHurt.l;
                    for (int i = 0; i < l.Count; i++)
                    {
                        HurtData hurtData = l[i];
                        bool     flag3    = hurtData.play(lHurt.maxComboNum);
                        bool     flag4    = flag3;
                        if (flag4)
                        {
                            i--;
                            l.Remove(hurtData);
                        }
                    }
                }
            }
        }
        //--------------------------------------------buff问题暂时注掉
        void on_rmv_state(Variant msgData)
        {
            debug.Log("移除buff" + msgData.dump());
            //uint iid = msgData["iid"];
            uint     iid    = msgData["iid"]._uint;
            BaseRole toRole = RoleMgr._instance.getRole(iid);

            if ((toRole != null && toRole.m_isMain) || iid == PlayerModel.getInstance().iid)
            {
                foreach (uint id in msgData["ids"]._arr)
                {
                    A3_BuffModel.getInstance().RemoveBuff(id);
                }
            }
            else
            {
                foreach (uint id in msgData["ids"]._arr)
                {
                    A3_BuffModel.getInstance().removeOtherBuff(toRole, id);
                }
            }
            //-------------------------------------------------------------
            //LGAvatarGameInst av = RoleMgr._instance.getRoleByIID(iid);
            //if (av == null)
            //    return;
            //List<Variant> ids = msgData["ids"]._arr;
            //foreach (Variant id in ids)
            //{
            //    av.removeBuffer(id);
            //}
        }
Example #4
0
        private void onUpdate(float s)
        {
            this.curTick++;
            bool flag = this.curTick < 40;

            if (!flag)
            {
                float    time     = Time.time;
                BaseRole baseRole = null;
                foreach (BaseRole current in this.dHurt.Keys)
                {
                    lHurt lHurt = this.dHurt[current];
                    this.doAtt(lHurt);
                    bool flag2 = baseRole == null && lHurt.Count == 0 && time - lHurt.lastTimer > 5f;
                    if (flag2)
                    {
                        baseRole = current;
                    }
                }
                bool flag3 = baseRole != null;
                if (flag3)
                {
                    this.dHurt.Remove(baseRole);
                }
            }
        }
Example #5
0
    public static void AddBullet(BaseRole locker, HitData bullet, float time)
    {
        FollowBullet_Mgr.m_unFollowBulletMakeID += 1u;
        OneFollowBlt oneFollowBlt = new OneFollowBlt();

        oneFollowBlt.id       = FollowBullet_Mgr.m_unFollowBulletMakeID;
        oneFollowBlt.beginpos = bullet.transform.position;
        oneFollowBlt.locker   = locker;
        oneFollowBlt.blt_hd   = bullet;
        oneFollowBlt.costtime = 0f;
        oneFollowBlt.maxtime  = time;
        Transform transform = bullet.transform.FindChild("t");
        bool      flag      = transform != null;

        if (flag)
        {
            oneFollowBlt.aniTrack      = transform.GetComponent <Animator>();
            transform.gameObject.layer = EnumLayer.LM_BT_FIGHT;
            Transform transform2 = transform.FindChild("f");
            bool      flag2      = transform2 != null;
            if (flag2)
            {
                oneFollowBlt.aniFx = transform2.GetComponent <Animator>();
            }
        }
        FollowBullet_Mgr.m_mapFollowBullet.Add(FollowBullet_Mgr.m_unFollowBulletMakeID, oneFollowBlt);
    }
        void onUpdate(float s)
        {
            curTick++;
            if (curTick < 40)
            {
                return;
            }

            float    t             = Time.time;
            BaseRole needRemoveKey = null;

            foreach (BaseRole go in dHurt.Keys)
            {
                lHurt lHurtD = dHurt[go];
                doAtt(lHurtD);

                if (needRemoveKey == null && lHurtD.Count == 0 && t - lHurtD.lastTimer > 5f)
                {
                    needRemoveKey = go;
                }
            }

            if (needRemoveKey != null)
            {
                dHurt.Remove(needRemoveKey);
            }
        }
Example #7
0
        private void on_rmv_state(Variant msgData)
        {
            debug.Log("移除buff" + msgData.dump());
            uint     @uint = msgData["iid"]._uint;
            BaseRole role  = RoleMgr._instance.getRole(@uint);
            bool     flag  = role != null && role.m_isMain;

            if (flag)
            {
                using (List <Variant> .Enumerator enumerator = msgData["ids"]._arr.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        uint id = enumerator.Current;
                        ModelBase <A3_BuffModel> .getInstance().RemoveBuff(id);
                    }
                }
            }
            else
            {
                using (List <Variant> .Enumerator enumerator2 = msgData["ids"]._arr.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        uint id2 = enumerator2.Current;
                        ModelBase <A3_BuffModel> .getInstance().removeOtherBuff(role, id2);
                    }
                }
            }
        }
        public override void Execute(float delta_time)
        {
            SelfRole._inst.m_curAni.SetBool(EnumAni.ANI_RUN, true);

            BaseRole target = SelfRole._inst.m_LockRole;

            if (target == null)
            {//目标丢失, 切换至空闲状态
                SelfRole.fsm.ChangeState(StateIdle.Instance);
                return;
            }
            Vector3 hisPos = target.m_curModel.position;
            Vector3 myPos  = SelfRole._inst.m_curModel.position;

            SelfRole._inst.TurnToPos(hisPos);

            if (Vector3.Distance(hisPos, myPos) < stop_distance)
            {//距离内,进入攻击状态
                SelfRole.fsm.ChangeState(StateAttack.Instance);
                return;
            }
            else
            {
                SelfRole._inst.m_rshelper.CheckMoveAgent(delta_time, resetImmediately: true);
            }
        }
Example #9
0
        private void on_single_skill_res(Variant msgData)
        {
            debug.Log("UUUUUUU" + msgData.dump());
            uint     @uint = msgData["to_iid"]._uint;
            uint     uint2 = msgData["frm_iid"]._uint;
            BaseRole role  = RoleMgr._instance.getRole(@uint);
            BaseRole role2 = RoleMgr._instance.getRole(uint2);
            bool     flag  = !msgData.ContainsKey("states");

            if (!flag)
            {
                bool flag2 = role != null && role.m_isMain;
                if (flag2)
                {
                    Variant variant = msgData["states"];
                    bool    flag3   = msgData["sid"];
                    if (flag3)
                    {
                        int type = msgData["sid"];
                        FightText.play(FightText.BUFF_TEXT, role.getHeadPos(), 0, false, type);
                    }
                    ModelBase <A3_BuffModel> .getInstance().addBuffList(variant);

                    bool flag4 = variant["id"] == 10000;
                    if (flag4)
                    {
                        BaseProxy <A3_ActiveProxy> .getInstance().dispatchEvent(GameEvent.Create(A3_ActiveProxy.EVENT_ONBLESS, this, variant, false));
                    }
                }
                else
                {
                    ModelBase <A3_BuffModel> .getInstance().addOtherBuff(role, msgData["states"]["id"]);
                }
                bool flag5 = msgData.ContainsKey("states");
                if (flag5)
                {
                    SXML   sXML    = XMLMgr.instance.GetSXML("skill.state", "id==" + msgData["states"]["id"]);
                    string @string = sXML.getString("effect");
                    bool   flag6   = role2 is MonsterRole && (role2 as MonsterRole).issummon && @uint == uint2;
                    if (flag6)
                    {
                        role2.PlaySkill(msgData["sid"]);
                    }
                    bool flag7 = @string != "null";
                    if (flag7)
                    {
                        float      @float     = sXML.getFloat("last");
                        GameObject original   = Resources.Load <GameObject>(@string);
                        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                        gameObject.transform.SetParent(role.m_curModel, false);
                        UnityEngine.Object.Destroy(gameObject, @float);
                        bool flag8 = sXML.getFloat("head") > 0f;
                        if (flag8)
                        {
                            gameObject.transform.localPosition = new Vector3(0f, role.headOffset_half.y / 2f + sXML.getFloat("head"), 0f);
                        }
                    }
                }
            }
        }
Example #10
0
        public void removeOtherBuff(BaseRole role, uint id)
        {
            SXML sXML = XMLMgr.instance.GetSXML("skill.state", "id==" + id);
            bool flag = sXML != null;

            if (flag)
            {
                SXML node  = sXML.GetNode("s", null);
                bool flag2 = node != null;
                if (flag2)
                {
                    int @int = node.getInt("tp");
                    if (@int == 7)
                    {
                        role.m_curAni.enabled = true;
                    }
                }
            }
            bool flag3 = role is P3Mage || role is ohterP3Mage;

            if (flag3)
            {
                bool flag4 = sXML.getInt("skill_id") == 3008;
                if (flag4)
                {
                    SelfRole._inst.PlaySkill(30081);
                }
            }
        }
Example #11
0
        private void on_casting_skill_res(Variant msgData)
        {
            debug.Log("释放怪物的大招技能???????????");
            debug.Log(msgData.dump());
            uint     iid   = msgData["iid"];
            uint     iid2  = msgData["to_iid"];
            uint     id    = msgData["skid"];
            BaseRole role  = RoleMgr._instance.getRole(iid2);
            BaseRole role2 = RoleMgr._instance.getRole(iid);
            bool     flag  = role2 != null && role != null;

            if (flag)
            {
                role2.m_LockRole = role;
                bool flag2 = msgData.ContainsKey("pos");
                if (flag2)
                {
                    float   x   = msgData["pos"]["x"]._float / 53.333f;
                    float   z   = msgData["pos"]["y"]._float / 53.333f;
                    Vector3 pos = new Vector3(x, role2.m_curModel.position.y, z);
                    role2.TurnToPos(pos);
                }
                else
                {
                    role2.TurnToRole(role, false);
                }
                role2.PlaySkill((int)id);
            }
        }
Example #12
0
        private void doHurt(BaseRole toRole, BaseRole frm, int damage, bool isdie, int hprest, int iscrit, bool miss, bool stagger, uint skill_id = 0u)
        {
            toRole.onServerHurt(damage, hprest, isdie, frm, iscrit, miss, stagger);
            bool flag = toRole.m_isMain && !miss;

            if (flag)
            {
                ModelBase <PlayerModel> .getInstance().modHp(hprest);
            }
            bool flag2 = frm != null;

            if (flag2)
            {
                bool flag3 = frm is M000P2 || frm is M000P3 || frm is M000P5 || frm is ohterP2Warrior || frm is ohterP3Mage || frm is ohterP5Assassin;
                if (flag3)
                {
                    frm.PlaySkill((int)skill_id);
                    frm.m_LockRole = toRole;
                }
            }
            bool flag4 = frm is ProfessionRole && toRole.m_isMain && SelfRole.fsm.Autofighting && ModelBase <AutoPlayModel> .getInstance().AutoPK > 0;

            if (flag4)
            {
                bool flag5 = StatePK.Instance.Enemy != frm && SelfRole.fsm.currentState != StatePK.Instance;
                if (flag5)
                {
                    StatePK.Instance.Enemy = (ProfessionRole)frm;
                    SelfRole.fsm.ChangeState(StatePK.Instance);
                }
            }
        }
Example #13
0
    /// <summary>
    /// 添加伤害体 TODO
    /// </summary>
    /// <param name="damageBodyObj"></param>
    /// <param name="skillId"></param>
    /// <param name="damageId"></param>
    /// <returns></returns>
    public DamageBody AddDamageBody(BaseRole host, int dirX, int dirY, int skillId, int damageId)
    {
        if (MapManager.Instance == null || MapManager.Instance.HasCurMap == false)
        {
            return(null);
        }
        DamageBodyInfo dbInfo = DamageDataManager.Instance.GetDamageBodyInfo(damageId);

        if (dbInfo == null)
        {
            return(null);
        }

        GameObject obj = new GameObject();

        if (obj == null)
        {
            return(null);
        }
        string handleName = skillId + "_" + GetHandleIndex(); // 没想好

        obj.name = handleName;
        GlobalVarFun.AttachChild(m_rootObj, obj);
        DamageBody db = obj.AddComponent <DamageBody>();

        db.InitDamage(host, handleName, dirX, dirY, skillId, dbInfo);
        m_damageBodyDic.Add(handleName, db);
        return(db);
    }
        public void removeOtherBuff(BaseRole role, uint id)
        {
            SXML xml = XMLMgr.instance.GetSXML("skill.state", "id==" + id);

            if (xml != null)
            {
                SXML xml_node = xml.GetNode("s", null);
                if (xml_node != null)
                {
                    switch (xml_node.getInt("tp"))
                    {
                    case 7:
                        role.m_curAni.enabled = true;
                        break;
                    }
                }
            }

            if (role is P3Mage || role is ohterP3Mage)
            {
                //法师盾的buffid
                if (xml.getInt("skill_id") == 3008)
                {
                    SelfRole._inst.PlaySkill(30081);
                }
            }
        }
Example #15
0
        public AudioForm(AudioMessage am,bool isFrom)
        {
            InitializeComponent();
           
            image.Source = new BitmapImage(new Uri(imageSouce, UriKind.Relative));
            image.Stretch = Stretch.Fill;
            this.am = am;
            this.isFrom = isFrom;

            Member from=am.from as Member;
            Member to =am.to as Member;
            this.Closed += AudioForm_Closed;
            ///语音发起者
            if (isFrom)
            {
                btnAccept.Visibility = Visibility.Collapsed;
                grid.ColumnDefinitions.RemoveAt(4);
                this.Width = 240;
                this.role = am.to;
                nickName.Text = to.nickName;
                DataUtil.AudioForms.Add(to.id, this);
            }
            ///语音接受者
            else
            {
                this.role = am.from;
                nickName.Text = from.nickName;
                DataUtil.AudioForms.Add(from.id, this);
            }

            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick += timer_Tick;
           
        }
Example #16
0
        /// <summary>
        /// 实现对角色的修改
        /// </summary>
        /// <param name="roleInfo">传递过来角色的实体类</param>
        /// <returns>返回执行成功的标志</returns>
        public ActionResult UpdateRoleInfo(BaseRole roleInfo)
        {
            var editRoleInfo = _roleInfoService.LoadEntities(c => c.ID == roleInfo.ID).FirstOrDefault();

            if (editRoleInfo == null)
            {
                return(Content("错误信息,请您检查"));
            }
            editRoleInfo.Realname     = roleInfo.Realname;
            editRoleInfo.CategoryCode = roleInfo.CategoryCode;
            editRoleInfo.AllowEdit    = roleInfo.AllowEdit;
            editRoleInfo.IsVisible    = roleInfo.IsVisible;
            editRoleInfo.SortCode     = roleInfo.SortCode;
            editRoleInfo.Enabled      = roleInfo.Enabled;
            editRoleInfo.Description  = roleInfo.Description;
            editRoleInfo.ModifiedOn   = DateTime.Parse(DateTime.Now.ToString());
            BaseUser user = Session["UserInfo"] as BaseUser;

            editRoleInfo.ModifiedUserID = user.Code;     //获取修改信息的ID
            editRoleInfo.ModifiedBy     = user.UserName; //获取修改此用户的用户名
            if (_roleInfoService.UpdateEntity() > 0)
            {
                return(Content("OK"));
            }
            return(Content("error"));
        }
    static public void AddBullet(BaseRole locker, HitData bullet, float time)
    {
        m_unFollowBulletMakeID++;

        OneFollowBlt blt = new OneFollowBlt();

        blt.id       = m_unFollowBulletMakeID;
        blt.beginpos = bullet.transform.position;
        blt.locker   = locker;
        blt.blt_hd   = bullet;
        blt.costtime = 0;
        blt.maxtime  = time;

        Transform real_track = bullet.transform.FindChild("t");

        if (real_track != null)
        {
            //HitData hd = m_linkProfessionRole.Link_PRBullet(2004, 2f, bult, real_track);
            //hd.m_Color_Main = Color.gray;
            //hd.m_Color_Rim = Color.white;

            blt.aniTrack = real_track.GetComponent <Animator>();
            real_track.gameObject.layer = EnumLayer.LM_BT_FIGHT;

            Transform real_fx = real_track.FindChild("f");
            if (real_fx != null)
            {
                blt.aniFx = real_fx.GetComponent <Animator>();
            }
        }



        m_mapFollowBullet.Add(m_unFollowBulletMakeID, blt);
    }
Example #18
0
        public override void Execute(float delta_time)
        {
            SelfRole._inst.m_curAni.SetBool(EnumAni.ANI_RUN, true);
            BaseRole lockRole = SelfRole._inst.m_LockRole;
            bool     flag     = lockRole == null;

            if (flag)
            {
                SelfRole.fsm.ChangeState(StateIdle.Instance);
            }
            else
            {
                Vector3 position  = lockRole.m_curModel.position;
                Vector3 position2 = SelfRole._inst.m_curModel.position;
                SelfRole._inst.TurnToPos(position);
                bool flag2 = Vector3.Distance(position, position2) < this.stop_distance;
                if (flag2)
                {
                    SelfRole.fsm.ChangeState(StateAttack.Instance);
                }
                else
                {
                    SelfRole._inst.m_rshelper.CheckMoveAgent(delta_time, 0.5f, true);
                }
            }
        }
        void on_cast_ground_skill(Variant msgData)
        {
            debug.Log("定点放技能:" + msgData.dump());

            uint tm      = msgData["start_tm"];
            uint frm_iid = msgData["frm_iid"]._uint;

            BaseRole frmRole = RoleMgr._instance.getRole(frm_iid);

            if (frmRole == null || (frmRole is SelfRole))
            {
                return;
            }

            int   sid = msgData["sid"];
            float x   = msgData["x"]._float * GameConstant.GEZI / GameConstant.PIXEL_TRANS_UNITYPOS;
            float y   = msgData["y"]._float * GameConstant.GEZI / GameConstant.PIXEL_TRANS_UNITYPOS;

            //NavMeshHit hit;
            Vector3 vec = new Vector3(x, frmRole.m_curModel.position.y, y);

            // NavMesh.SamplePosition(vec, out hit, 100f, frmRole.m_layer);

            //frmRole.TurnToPos(hit.position);
            if (frmRole is MS0000)
            {
                (frmRole as MS0000).ismapEffect = true;
                (frmRole as MS0000).effectVec   = vec;
                frmRole.PlaySkill(sid);
            }
        }
Example #20
0
 /// <summary>
 /// Sets the permission mask to the mask of the role specified in the
 /// BaseRole property.
 /// </summary>
 /// <param name="role">The role to be modified.</param>
 private void SetBaseRolePermissions(SPRole role)
 {
     if (!BaseRole.Equals(string.Empty))
     {
         SPRole baseRole = role.ParentWeb.Roles[BaseRole];
         role.PermissionMask = baseRole.PermissionMask;
     }
 }
Example #21
0
        public static BaseRole RefreshLockRoleTransform(BaseRole LockRole)
        {
            bool     flag = LockRole is MonsterRole;
            BaseRole result;

            if (flag)
            {
                result = LockRole;
            }
            else
            {
                bool flag2 = LockRole.isDead || LockRole == null;
                if (flag2)
                {
                    result = null;
                }
                else
                {
                    switch (ModelBase <PlayerModel> .getInstance().now_pkState)
                    {
                    case 0:
                        result = null;
                        return(result);

                    case 1:
                    {
                        bool flag3 = LockRole is ProfessionRole;
                        if (!flag3)
                        {
                            result = LockRole;
                            return(result);
                        }
                        bool flag4 = OtherPlayerMgr._inst.m_mapOtherPlayer[LockRole.m_unIID].zhuan < 1;
                        if (flag4)
                        {
                            result = null;
                            return(result);
                        }
                        break;
                    }

                    case 4:
                    {
                        bool flag5 = LockRole is ProfessionRole && LockRole.rednm > 0;
                        if (flag5)
                        {
                            result = LockRole;
                            return(result);
                        }
                        result = null;
                        return(result);
                    }
                    }
                    result = LockRole;
                }
            }
            return(result);
        }
Example #22
0
    public BaseRole GetBaseRole(string handleName)
    {
        BaseRole role = null;

        if (m_roleDic.TryGetValue(handleName, out role))
        {
            return(role);
        }
        return(null);
    }
Example #23
0
        public void onAttackBeginHanle(BaseRole go, int num)
        {
            bool flag = !this.dHurt.ContainsKey(go);

            if (flag)
            {
                this.dHurt[go] = new lHurt();
            }
            this.dHurt[go].maxComboNum = num;
        }
Example #24
0
        public MyMenu(BaseRole role,MessageType messageType)
        {
            InitializeComponent();
            string menuName=String.Empty;
            switch (messageType)
            {
                case MessageType.File:
                    {
                        menuName = "发送文件";
                        break;
                        
                    }
                case MessageType.Audio:
                    {
                        menuName = "语音";
                        break;
                    }
            }


            this.baseRole = role;
            this.messageType = messageType;
            txtName = new TextBlock();
            txtName.FontSize = fontSize;
            txtName.Foreground = new SolidColorBrush(Colors.White);
            txtName.Text = menuName;
            txtName.TextWrapping = TextWrapping.Wrap;
            txtName.VerticalAlignment = VerticalAlignment.Center;
            txtName.HorizontalAlignment = HorizontalAlignment.Center;
            Grid.SetRow(txtName,0);
            this.Children.Add(txtName);
            this.Width = weight;
            this.Height = height;
            this.onlineColor = DataUtil.GetRandomColor();


            ///鼠标进入事件,放大
            this.MouseEnter += MyMenu_MouseEnter;
            ///鼠标离开事件,恢复
            this.MouseLeave += MyMenu_MouseLeave;

            ///鼠标点击事件

            //this.MouseLeftButtonUp += MyMenu_MouseLeftButtonUp;
           // this.AddHandler(Button.MouseLeftButtonUpEvent, new MouseButtonEventHandler(this.MyMenu_MouseLeftButtonUp), true);
           this.MouseLeftButtonDown += MyMenu_MouseLeftButtonDown;
            if (this.baseRole is Member)
            {
                Member member = this.baseRole as Member;
                if (member.status == MemberStatus.Online)
                    this.Background = new SolidColorBrush(onlineColor);
                else if (member.status == MemberStatus.Offline)
                    this.Background = new SolidColorBrush(offlineColor);
            }
        }
Example #25
0
 //{
 //    set { minRange = value;/*Mathf.Max(value,1.5f); */}
 //    get { return minRange; }
 //}
 public override void Enter()
 {
     if (muNetCleint.instance.CurServerTimeStamp - exe_action_tm < xml_action_tm || SelfRole._inst.isPlayingSkill)
     {
         return;
     }
     BattleProxy.getInstance().addEventListener(BattleProxy.EVENT_SELF_KILL_MON, OnKillMon);
     //xml_action_tm = 0.0f;
     CHECK_AGAIN : CheckPK();
     if (!SelfRole.UnderPlayerAttack)
     {
         if (PlayerModel.getInstance().pk_state != PK_TYPE.PK_PEACE)
         {
             BaseRole plr = OtherPlayerMgr._inst.FindNearestEnemyOne(SelfRole._inst.m_curModel.transform.position, selector: EnemySelector, pkState: PlayerModel.getInstance().pk_state);
             if (plr != null)
             {
                 SelfRole._inst.m_LockRole = plr;
                 return;
             }
         }
         if ((SelfRole._inst.m_LockRole is ProfessionRole && PlayerModel.getInstance().pk_state == PK_TYPE.PK_PEACE) ||
             SelfRole._inst.m_LockRole == null)
         {
             MonsterRole mon = MonsterMgr._inst.FindNearestMonster(/*SelfRole.fsm.Autofighting ? StateInit.Instance.Origin :*/ SelfRole._inst.m_curModel.position);
             if (mon == null)
             {
                 SelfRole.fsm.ChangeState(StateIdle.Instance);
                 return;
             }
             SelfRole._inst.m_LockRole = mon;
         }
         else
         {
             if (SelfRole.fsm.Autofighting &&
                 Vector3.Distance(SelfRole._inst.m_LockRole.m_curModel.position.ConvertToGamePosition(), SelfRole._inst.m_curModel.position.ConvertToGamePosition()) > StateInit.Instance.Distance)
             {
                 SelfRole._inst.m_LockRole = null;
                 SelfRole.fsm.ChangeState(StateIdle.Instance);
             }
         }
         return;
     }
     else
     {
         if (SelfRole.LastAttackPlayer != null)
         {
             SelfRole._inst.m_LockRole = SelfRole.LastAttackPlayer;
         }
         else
         {
             SelfRole.UnderPlayerAttack = false;
             goto CHECK_AGAIN;
         }
     }
 }
Example #26
0
 public void AddDamageRole(string roleHandle)
 {
     if (false == IsInDamageRoleList(roleHandle))
     {
         BaseRole role = RoleManager.Instance.GetBaseRole(roleHandle);
         if (role != null)
         {
             m_damageRoles.Add(role);
         }
     }
 }
Example #27
0
        public void addEff(BaseRole frm, BaseRole to, GameObject eff, float sec)
        {
            EffItm effItm = new EffItm();

            effItm.to  = to;
            effItm.frm = frm;
            effItm.eff = eff;
            effItm.sec = sec;
            eff.transform.SetParent(U3DAPI.FX_POOL_TF, false);
            this.lEff.Add(effItm);
        }
Example #28
0
        private void on_die(Variant msgData)
        {
            uint     @uint = msgData["iid"]._uint;
            BaseRole role  = RoleMgr._instance.getRole(@uint);
            bool     flag  = role == null;

            if (!flag)
            {
                this.doHurt(role, null, 0, true, -1, -1, false, false, 0u);
            }
        }
Example #29
0
        public void setHurt(BaseRole from, BaseRole to, hurtInfo hurtD, bool useCombo = false)
        {
            bool flag = !this.dHurt.ContainsKey(from);

            if (flag)
            {
                this.dHurt[from] = new lHurt();
            }
            HurtData d = new HurtData(to, hurtD, useCombo);

            this.dHurt[from].add(d);
        }
        public void setHurt(BaseRole from, BaseRole to, hurtInfo hurtD, bool useCombo = false)
        {
            //  debug.Log("setHurt!!! " + hurtD["dmg"] + "" + hurtD["frm_iid"] + " " + hurtD["to_iid"]);

            if (!dHurt.ContainsKey(from))
            {
                dHurt[from] = new lHurt();
            }
            HurtData d = new HurtData(to, hurtD, useCombo);

            dHurt[from].add(d);
        }
Example #31
0
    /// <summary>
    /// 设置伤害体初始数据
    /// </summary>
    /// <returns></returns>
    public bool InitDamage(BaseRole host, string handleName, int dirX, int dirY, int skillId, DamageBodyInfo node)
    {
        if (host == null || node == null)
        {
            m_bStarted = false;
            return(false);
        }
        m_host           = host;
        m_sHandleName    = handleName;
        m_iSkillID       = skillId;
        m_eDamageType    = (eDamageBodyType)node.DamageType;
        m_eMoveType      = (eDamageMoveType)node.MoveType;
        m_damageBodyInfo = node;
        // TODO 可能有很多个?
        GameObject prefabObj = Resource.LoadObj(m_damageBodyInfo.PrefabName) as GameObject;

        if (null == prefabObj)
        {
            m_bStarted = false;
            return(false);
        }
        GameObject showObj = GameObject.Instantiate(prefabObj);

        showObj.name = "node";
        GlobalVarFun.AttachChild(gameObject, showObj);
        m_fWidth       = m_damageBodyInfo.Width;
        m_fHeight      = m_damageBodyInfo.Height;
        m_fEsTime      = m_damageBodyInfo.EsTime;
        m_iDamageCount = m_damageBodyInfo.DamageCount;
        m_iDamage      = m_damageBodyInfo.DamageValue;
        m_fPosX        = host.m_fPositionX + m_damageBodyInfo.OffsetX;
        m_fPosY        = host.m_fPositionY + m_damageBodyInfo.OffsetY;
        m_iDirX        = dirX;
        m_iDirY        = dirY;
        m_fVelocityX   = dirX * m_damageBodyInfo.MoveVelocity;
        m_fVelocityY   = dirY * m_damageBodyInfo.MoveVelocity;
        m_velocity.x   = m_fVelocityX;
        m_velocity.y   = m_fVelocityY;

        if (m_mapDamage == null)
        {
            m_mapDamage = new MapDamage(this);
        }
        m_mapDamage.InitB2Body(MapManager.Instance.curMapWorld, m_fPosX, m_fPosY, m_fWidth, m_fHeight);
        m_mapDamage.SetCurVelocityX(m_fVelocityX);
        m_mapDamage.SetCurVelocityY(m_fVelocityY);

        Clear();
        m_bStarted   = true;
        m_fBeginTime = GlobalVarFun.GetTime();
        return(true);
    }
Example #32
0
    public void RemoveDamageRole(string roleHandle)
    {
        BaseRole role = null;

        for (int i = m_damageRoles.Count - 1; i >= 0; i--)
        {
            role = m_damageRoles[i];
            if (role != null && role.m_sHandleName == roleHandle)
            {
                m_damageRoles.RemoveAt(i);
            }
        }
    }
Example #33
0
	public static void DataBind(BaseRole obj)
	{
		
		Type type = obj.GetType();
		

		PropertyInfo[] infos = type.GetProperties();
//		PropertyInfo inf = type.GetProperty("roleName");
		Debug.Log ("aa:"+type.Name);
		foreach (PropertyInfo info in infos)
		{
				if ("roleName" == info.Name)
				{
					GameObject.Find("uname").GetComponent<UILabel>().text = info.GetValue(obj, null).ToString();
					Debug.Log ("info.Name :" + info.Name + "   value: "+ info.GetValue(obj, null).ToString());

				}

		}
		obj.updateType = false;
		
	}
Example #34
0
        /// <summary>
        /// MyButton构造函数
        /// </summary>
        /// <param name="type">Button类型</param>
        /// <param name="baseRole">Member或者UserGroup或者Group</param>
        /// <param name="imagesouce">如果是用户,用户头像,其他目前为空</param>
        /// <param name="color">Button颜色</param>
        public MyButton(MyType type, BaseRole baseRole, string imagesouce, string baserRoleId = "-1")
            : base()
        {
            ///设置分组ID
            this.baseRoleId = baserRoleId;
            ///设置类型
            this.type = type;
            ///设置对象Member或者UserGroup或者Group
            this.baseRole = baseRole;
            this.onlineColor = DataUtil.GetRandomColor();


            #region 分组
            if (type == MyType.UserGroup)
            {
                UserGroup userGroup = baseRole as UserGroup;
                ///分组名称
                txtName = new TextBlock();
                txtName.Text = userGroup.userGroupName;
                txtName.FontSize = fontSize;
                txtName.Foreground = new SolidColorBrush(Colors.White);
                txtName.VerticalAlignment = VerticalAlignment.Center;
                txtName.HorizontalAlignment = HorizontalAlignment.Center;
                this.Children.Add(txtName);





                ///右键菜单
                ContextMenu cm = new ContextMenu();
                ///菜单的背景色
                cm.Background = new SolidColorBrush(Color.FromArgb(255, 114, 119, 123));
                ///菜单的前景色
                cm.Foreground = new SolidColorBrush(Colors.White);
                ///删除分组菜单项
                MenuItem deleteUserGroupMenuItem = new MenuItem();
                deleteUserGroupMenuItem.Header = "删除分组";
                ///删除分组事件
                deleteUserGroupMenuItem.Click += deleteUserGroupMenuItem_Click;
                cm.Items.Add(deleteUserGroupMenuItem);

                ///更改分组名菜单项
                MenuItem changeUserGroupNameItem = new MenuItem();
                changeUserGroupNameItem.Header = "更改分组名";
                ///更改分组名事件
                changeUserGroupNameItem.Click += changeUserGroupNameItem_Click;

                cm.Items.Add(changeUserGroupNameItem);

                this.ContextMenu = cm;
                this.Background = new SolidColorBrush(onlineColor);
            }
            #endregion

            #region 好友
            else if (type == MyType.User)
            {
                Member member = baseRole as Member;

                ///第一行用来放置头像
                RowDefinition row1 = new RowDefinition();
                row1.Height = new GridLength(zoomImageSize);
                ///第二行用来放置昵称
                RowDefinition row2 = new RowDefinition();
                //  row2.Height = new GridLength(imageHeight);
                this.RowDefinitions.Add(row1);
                this.RowDefinitions.Add(row2);

                ///用户头像
                image = new Image();
                image.Source = new BitmapImage(new Uri(imagesouce, UriKind.Relative));
                image.Height = imageSize;
                image.Width = imageSize;
                Grid.SetRow(image, 0);
                ///用户昵称
                txtName = new TextBlock();
                txtName.Text = member.nickName;
                txtName.FontSize = fontSize;
                txtName.Foreground = new SolidColorBrush(Colors.White);
                txtName.VerticalAlignment = VerticalAlignment.Center;
                txtName.HorizontalAlignment = HorizontalAlignment.Center;
                Grid.SetRow(txtName, 1);
                ///添加用户头像
                this.Children.Add(image);
                ///添加昵称
                this.Children.Add(txtName);



                ///右键菜单
                ContextMenu cm = new ContextMenu();
                ///菜单的背景色
                cm.Background = new SolidColorBrush(Color.FromArgb(255, 114, 119, 123));
                ///菜单的前景色
                cm.Foreground = new SolidColorBrush(Colors.White);
                ///删除好友菜单项
                MenuItem deleteFriendMenuItem = new MenuItem();
                deleteFriendMenuItem.Header = "删除好友";
                ///删除好友事件
                deleteFriendMenuItem.Click += deleteFriendMenuItem_Click;
                cm.Items.Add(deleteFriendMenuItem);

                ///查看好友资料菜单项
                MenuItem viewFriendMenuItemItem = new MenuItem();
                viewFriendMenuItemItem.Header = "查看资料";
                ///更改分组名事件
                viewFriendMenuItemItem.Click += viewFriendMenuItemItem_Click;

                cm.Items.Add(viewFriendMenuItemItem);

                this.ContextMenu = cm;
                if (member.status == MemberStatus.Online)
                    this.Background = new SolidColorBrush(onlineColor);
                else if (member.status == MemberStatus.Offline)
                    this.Background = new SolidColorBrush(offlineColor);



            }
            #endregion

            #region 群组成员
            else if (type == MyType.UserInGroup)
            {
                Member member = baseRole as Member;

                ///第一行用来放置头像
                RowDefinition row1 = new RowDefinition();
                row1.Height = new GridLength(zoomImageSize);
                ///第二行用来放置昵称
                RowDefinition row2 = new RowDefinition();
                //  row2.Height = new GridLength(imageHeight);
                this.RowDefinitions.Add(row1);
                this.RowDefinitions.Add(row2);

                ///成员头像
                image = new Image();
                image.Source = new BitmapImage(new Uri(imagesouce, UriKind.Relative));
                image.Height = imageSize;
                image.Width = imageSize;
                Grid.SetRow(image, 0);
                ///成员昵称
                txtName = new TextBlock();
                txtName.Text = member.nickName;
                txtName.FontSize = fontSize;
                txtName.Foreground = new SolidColorBrush(Colors.White);
                txtName.VerticalAlignment = VerticalAlignment.Center;
                txtName.HorizontalAlignment = HorizontalAlignment.Center;
                Grid.SetRow(txtName, 1);
                ///添加成员头像
                this.Children.Add(image);
                ///添加昵称
                this.Children.Add(txtName);



                ///右键菜单
                ContextMenu cm = new ContextMenu();
                ///菜单的背景色
                cm.Background = new SolidColorBrush(Color.FromArgb(255, 114, 119, 123));
                ///菜单的前景色
                cm.Foreground = new SolidColorBrush(Colors.White);

                if (DataUtil.GetGroupById(baserRoleId).OwnerId == DataUtil.Member.id)
                {
                    ///删除成员菜单项
                    MenuItem deleteMemberFromGroupMenuItem = new MenuItem();
                    deleteMemberFromGroupMenuItem.Header = "删除成员";
                    ///删除成员事件
                    deleteMemberFromGroupMenuItem.Click += deleteMemberFromGroupMenuItem_Click;
                    cm.Items.Add(deleteMemberFromGroupMenuItem);
                }
                ///查看好友资料菜单项
                MenuItem viewFriendMenuItemItem = new MenuItem();
                viewFriendMenuItemItem.Header = "查看资料";
                ///更改分组名事件
                viewFriendMenuItemItem.Click += viewFriendMenuItemItem_Click;

                cm.Items.Add(viewFriendMenuItemItem);

                this.ContextMenu = cm;
                if (member.status == MemberStatus.Online)
                    this.Background = new SolidColorBrush(onlineColor);
                else if (member.status == MemberStatus.Offline)
                    this.Background = new SolidColorBrush(offlineColor);
            }
            #endregion

            #region 群组
            else  if (type == MyType.Group)
            {
                Group group = baseRole as Group;
                ///群组名称
                txtName = new TextBlock();
                txtName.Text = group.Name;
                txtName.FontSize = fontSize;
                txtName.Foreground = new SolidColorBrush(Colors.White);
                txtName.VerticalAlignment = VerticalAlignment.Center;
                txtName.HorizontalAlignment = HorizontalAlignment.Center;
                this.Children.Add(txtName);





                ///右键菜单
                ContextMenu cm = new ContextMenu();
                ///菜单的背景色
                cm.Background = new SolidColorBrush(Color.FromArgb(255, 114, 119, 123));
                ///菜单的前景色
                cm.Foreground = new SolidColorBrush(Colors.White);

                if (group.OwnerId == DataUtil.Member.id)
                {
                    ///解散群组菜单项
                    MenuItem dismissGroupMenuItem = new MenuItem();
                    dismissGroupMenuItem.Header = "解散群组";
                    ///解散分组事件
                    dismissGroupMenuItem.Click += dismissGroupMenuItem_Click;
                    cm.Items.Add(dismissGroupMenuItem); 
                    this.ContextMenu = cm;
                }
               
              

               
                this.Background = new SolidColorBrush(onlineColor);
            }
            #endregion

            ///背景色为MyGrid里面传进来的颜色

            this.Width = weight;
            this.Height = height;

            ///鼠标进入事件,放大
            this.MouseEnter += MyButton_MouseEnter;
            ///鼠标离开事件,恢复
            this.MouseLeave += MyButton_MouseLeave;

            ///鼠标点击事件
            this.MouseLeftButtonUp += MyButton_LeftButtonUp;

        }
Example #35
0
        public void SetStatus(MemberStatus status)
        {

            Member member=this.baseRole as Member;
            switch (status)
            {
                case MemberStatus.Online:
                    {
                        member.status=MemberStatus.Online;
                        this.baseRole = member;
                        this.Background = new SolidColorBrush(this.onlineColor);
                        break;
                    }

                case MemberStatus.Offline:
                    {
                        member.status = MemberStatus.Offline;
                        this.baseRole = member;
                        this.Background = new SolidColorBrush(this.offlineColor);
                        break;
                    }
            }

        }
Example #36
0
        public MyMessageTabItem(MyType type, BaseRole role)
        {
            this.type = type;
            this.role = role;

            switch (type)
            {
                case MyType.User:
                    {

                        Member member = role as Member;
                        sendFileMenu = new MyMenu(role,MessageType.File);
                        audioMenu = new MyMenu(role,MessageType.Audio);
                        
                        RowDefinition row1 = new RowDefinition();
                        row1.Height = new GridLength(50);
                        RowDefinition row2 = new RowDefinition();
                        RowDefinition row3 = new RowDefinition();
                        RowDefinition row4 = new RowDefinition();
                        row4.Height = new GridLength(10);
                        row3.Height = new GridLength(80);
                        grid.RowDefinitions.Add(row1);
                        grid.RowDefinitions.Add(row2);
                        grid.RowDefinitions.Add(row3);
                        grid.RowDefinitions.Add(row4);


                        this.rtxtBox.Background = new SolidColorBrush(Colors.Transparent);
                        rtxtBox.IsReadOnly = true;
                        rtxtBox.FontSize = 17;
                        rtxtBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
                        rtxtBox.Foreground = new SolidColorBrush(Colors.White);
                        rtxtBox.Document.LineHeight = 0.1;
                        rtxtBox.Document.Blocks.Clear();



                        Grid.SetRow(rtxtBox, 1);
                        grid.Children.Add(rtxtBox);



                        menuGrid = new Grid();
                        ColumnDefinition column1 = new ColumnDefinition();
                        column1.Width = new GridLength(40);
                        ColumnDefinition column2 = new ColumnDefinition();
                        column2.Width = new GridLength(200);
                        ColumnDefinition column3 = new ColumnDefinition();
                        column3.Width = new GridLength(40);
                        ColumnDefinition column4 = new ColumnDefinition();
                        column4.Width = new GridLength(40);
                        ColumnDefinition column5 = new ColumnDefinition();
                        column5.Width = new GridLength(40);

                        menuGrid.ColumnDefinitions.Add(column1);
                        menuGrid.ColumnDefinitions.Add(column2);
                        menuGrid.ColumnDefinitions.Add(column3);
                        menuGrid.ColumnDefinitions.Add(column4);
                        menuGrid.ColumnDefinitions.Add(column5);


                        image = new Image();
                        image.Source = new BitmapImage(new Uri(imageSouce, UriKind.Relative));
                        image.Height = imageSize;
                        image.Width = imageSize;
                        Grid.SetRow(image, 0);


                        TextBlock txtName = new TextBlock();
                        txtName.Text = member.nickName;
                        txtName.FontSize = 25;
                        txtName.Foreground = new SolidColorBrush(Colors.White);





                        Grid.SetColumn(image, 0);
                        menuGrid.Children.Add(image);
                        Grid.SetColumn(txtName, 1);
                        menuGrid.Children.Add(txtName);
                        Grid.SetColumn(sendFileMenu, 2);
                        menuGrid.Children.Add(sendFileMenu);
                        Grid.SetColumn(audioMenu, 3);
                        menuGrid.Children.Add(audioMenu);



                        Grid.SetRow(menuGrid, 0);
                        grid.Children.Add(menuGrid);



                        txtInput = new TextBox();
                        txtInput.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
                        txtInput.KeyDown += txtInput_KeyDown;
                        txtInput.FontSize = 15;
                        txtInput.TextWrapping = TextWrapping.Wrap;


                        Border border = new Border();
                        border.BorderThickness = new Thickness(2);
                        border.BorderBrush = new SolidColorBrush(Colors.SkyBlue);

                        border.Child = txtInput;


                        Grid.SetRow(border, 2);
                        grid.Children.Add(border);

                        this.AddChild(grid);


                        break;
                    }


                case MyType.Group:
                    {

                        Group group = role as Group;

                        RowDefinition row1 = new RowDefinition();
                        row1.Height = new GridLength(50);
                        RowDefinition row2 = new RowDefinition();
                        RowDefinition row3 = new RowDefinition();
                        RowDefinition row4 = new RowDefinition();
                        row4.Height = new GridLength(10);
                        row3.Height = new GridLength(80);
                        grid.RowDefinitions.Add(row1);
                        grid.RowDefinitions.Add(row2);
                        grid.RowDefinitions.Add(row3);
                        grid.RowDefinitions.Add(row4);


                        this.rtxtBox.Background = new SolidColorBrush(Colors.Transparent);
                        rtxtBox.IsReadOnly = true;
                        rtxtBox.FontSize = 17;
                        rtxtBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
                        rtxtBox.Foreground = new SolidColorBrush(Colors.White);
                        rtxtBox.Document.LineHeight = 0.1;
                        rtxtBox.Document.Blocks.Clear();



                        Grid.SetRow(rtxtBox, 1);
                        grid.Children.Add(rtxtBox);



                        menuGrid = new Grid();
                        ColumnDefinition column1 = new ColumnDefinition();
                        column1.Width = new GridLength(40);
                        ColumnDefinition column2 = new ColumnDefinition();
                        column2.Width = new GridLength(200);
                        ColumnDefinition column3 = new ColumnDefinition();
                        column3.Width = new GridLength(40);
                        ColumnDefinition column4 = new ColumnDefinition();
                        column4.Width = new GridLength(40);
                        ColumnDefinition column5 = new ColumnDefinition();
                        column5.Width = new GridLength(40);

                        menuGrid.ColumnDefinitions.Add(column1);
                        menuGrid.ColumnDefinitions.Add(column2);
                        menuGrid.ColumnDefinitions.Add(column3);
                        menuGrid.ColumnDefinitions.Add(column4);
                        menuGrid.ColumnDefinitions.Add(column5);


                        image = new Image();
                        image.Source = new BitmapImage(new Uri(imageSouce, UriKind.Relative));
                        image.Height = imageSize;
                        image.Width = imageSize;
                        Grid.SetRow(image, 0);


                        TextBlock txtName = new TextBlock();
                        txtName.Text = group.Name;
                        txtName.FontSize = 25;
                        txtName.Foreground = new SolidColorBrush(Colors.White);





                        Grid.SetColumn(image, 0);
                        menuGrid.Children.Add(image);
                        Grid.SetColumn(txtName, 1);
                        menuGrid.Children.Add(txtName);





                        Grid.SetRow(menuGrid, 0);
                        grid.Children.Add(menuGrid);



                        txtInput = new TextBox();
                        txtInput.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
                        txtInput.KeyDown += txtInput_KeyDown;
                        txtInput.FontSize = 15;
                        txtInput.TextWrapping = TextWrapping.Wrap;


                        Border border = new Border();
                        border.BorderThickness = new Thickness(2);
                        border.BorderBrush = new SolidColorBrush(Colors.SkyBlue);

                        border.Child = txtInput;


                        Grid.SetRow(border, 2);
                        grid.Children.Add(border);

                        this.AddChild(grid);


                        break;
                    }
            }




        }
Example #37
0
 public static void SetCurrentMessageWindow(BaseRole baseRole)
 {
     
     if(baseRole is Member)
     {
         Member member=baseRole as Member;
         MessageTabControl.SelectedItem = FriendMessageTabItems[member.id];
         CurrentMessageTabItem=FriendMessageTabItems[member.id];   
     }
     else if (baseRole is Group)
     {
         Group group = baseRole as Group;
         MessageTabControl.SelectedItem=GroupMessageTabItems[group.GroupId];
         CurrentMessageTabItem = GroupMessageTabItems[group.GroupId];
       
     }
 }
Example #38
0
            AddButton(MyType type, BaseRole role)
        {

            if (type == MyType.UserGroup)
            {

                UserGroup userGroup = role as UserGroup;
                int index = DataUtil.UserGroups.Count;

                rowCount = (index) / columnCount + 1;
                InitRowAndColumn();




                MyButton button = new MyButton(MyType.UserGroup, role, null);
                Grid.SetColumn(button, index % columnCount);
                Grid.SetRow(button, index / columnCount);
                this.Children.Add(button);
               // if(!DataUtil.UserGroups.Contains(userGroup))
                 DataUtil.UserGroups.Add(userGroup);

            }

            else if (type == MyType.User)
            {

                Member member = role as Member;
                int index = DataUtil.GetMemberList(baseRoleId).Count;

                rowCount = (index) / columnCount + 1;
                InitRowAndColumn();


                Random random = new Random((int)DateTime.Now.Ticks);


                MyButton button = new MyButton(MyType.User, role, imageSouce, baseRoleId);
                Grid.SetColumn(button, index % columnCount);
                Grid.SetRow(button, index / columnCount);
                this.Children.Add(button);

               if( !DataUtil.IsFriend(member.id))
                 DataUtil.AddFriendTo(member,baseRoleId);
            }

            else if (type == MyType.Group)
            {
                Group g = role as Group;
                int index = DataUtil.Groups.Count ;

                rowCount = (index) / columnCount + 1;
                InitRowAndColumn();


                Random random = new Random((int)DateTime.Now.Ticks);


                MyButton button = new MyButton(MyType.Group, role, imageSouce);
                Grid.SetColumn(button, index % columnCount);
                Grid.SetRow(button, index / columnCount);
                this.Children.Add(button);
                ///将组添加到记录里面
                if(!DataUtil.Groups.Contains(g))
                    DataUtil.Groups.Add(role as Group);

            }
            else if (type == MyType.UserInGroup)
            {
                int index = DataUtil.GetGroupMemberList(baseRoleId).Count;

                rowCount = (index) / columnCount + 1;
                InitRowAndColumn();


                Random random = new Random((int)DateTime.Now.Ticks);


                MyButton button = new MyButton(MyType.UserInGroup, role, imageSouce, baseRoleId);
                Grid.SetColumn(button, index % columnCount);
                Grid.SetRow(button, index / columnCount);
                this.Children.Add(button);

                DataUtil.AddMember2Group(role as Member, baseRoleId);
            }


        }