예제 #1
0
        public int GetFreePos(COM_PLAYERCAMP camp, int maxPlayerNum)
        {
            ListView <Assets.Scripts.GameSystem.MemberInfo> view = this[camp];

            if (view != null)
            {
                for (int i = 0; i < (maxPlayerNum / 2); i++)
                {
                    bool flag = false;
                    for (int j = 0; j < view.Count; j++)
                    {
                        Assets.Scripts.GameSystem.MemberInfo info = view[j];
                        if ((info != null) && (info.dwPosOfCamp == i))
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (!flag)
                    {
                        return(i);
                    }
                }
            }
            return(-1);
        }
예제 #2
0
        public void SortCampMemList(COM_PLAYERCAMP camp)
        {
            ListView <Assets.Scripts.GameSystem.MemberInfo>         view = this.campMemberList[(int)camp];
            SortedList <uint, Assets.Scripts.GameSystem.MemberInfo> list = new SortedList <uint, Assets.Scripts.GameSystem.MemberInfo>();

            ListView <Assets.Scripts.GameSystem.MemberInfo> .Enumerator enumerator = view.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Assets.Scripts.GameSystem.MemberInfo current = enumerator.Current;
                uint dwPosOfCamp = current.dwPosOfCamp;
                list.Add(dwPosOfCamp, current);
            }
            this.campMemberList[(int)camp] = new ListView <Assets.Scripts.GameSystem.MemberInfo>(list.Values);
        }
예제 #3
0
 public bool IsHaveHeroByID(Assets.Scripts.GameSystem.MemberInfo mInfo, uint heroID)
 {
     if (mInfo.canUseHero != null)
     {
         int length = mInfo.canUseHero.Length;
         for (int i = 0; i < length; i++)
         {
             if (mInfo.canUseHero[i] == heroID)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
예제 #4
0
 public static bool IsSameMemeber(Assets.Scripts.GameSystem.MemberInfo member, COM_PLAYERCAMP camp, int pos)
 {
     return(((member != null) && (member.camp == camp)) && (member.dwPosOfCamp == pos));
 }