Exemple #1
0
 public void unsit(Slot player, int index, TexasSitDownListener listener)
 {
     setLose(player);
     // push sit downinfo to all user;
     sendSitDownInfoToAllUserInRoom(player, index, false, listener);
     // Slots[index].emptySlot();
     player.emptySlot();
 }
Exemple #2
0
        internal bool sit(string userKey, int index, TexasSitDownListener listener)
        {
            TexasRoomUser texasRoomUser = getTexasRoomUser(userKey);

            if (texasRoomUser == null)
            {
                return(false);
            }
            return(sit(texasRoomUser, index, listener));
        }
Exemple #3
0
 public void unsit(Slot player, TexasSitDownListener listener)
 {
     for (int index = 0; index < this.Slots.Length; index++)
     {
         if (player != this.Slots[index])
         {
             continue;
         }
         unsit(player, index, listener);
         return;
     }
 }
Exemple #4
0
 internal void forceUnsitIfNotEnoughtMoney(TexasSitDownListener listener)
 {
     for (int index = 0; index < this.Slots.Length; index++)
     {
         Slot slot = this.Slots[index];
         if (slot.isEmpty())
         {
             continue;
         }
         if (slot.CurrentCredit < this.SmallBlindValue * 2) // Big Blind
         {
             unsit(slot, index, listener);
         }
     }
 }
Exemple #5
0
 public void unsit(string UserKey, TexasSitDownListener listener)
 {
     for (int index = 0; index < this.Slots.Length; index++)
     {
         if (this.Slots[index].isEmpty())
         {
             continue;
         }
         if (this.Slots[index].UserKey == UserKey)
         {
             unsit(this.Slots[index], index, listener);
             return;
         }
     }
 }
Exemple #6
0
        public bool sit(TexasRoomUser texasRoomUser, int index, TexasSitDownListener listener)
        {
            if (texasRoomUser == null)
            {
                return(false);
            }
            if (!this.Slots[index].isEmpty())
            {
                return(false); // this slot ready busy
            }
            Slot slot = this.Slots[index];

            slot.UserKey  = texasRoomUser.UserKey;
            slot.UserName = texasRoomUser.UserName;
            sendSitDownInfoToAllUserInRoom(slot, index, true, listener);
            return(true);
        }
Exemple #7
0
        public Slot leaveRoom(string UserKey, TexasSitDownListener listener)
        {
            if (this.TexasRoomUsers.ContainsKey(UserKey))
            {
                TexasRoomUsers.Remove(UserKey);
            }

            // check if playing
            for (int index = 0; index < this.Slots.Length; index++)
            {
                Slot player = this.Slots[index];
                if (player.isEmpty()) // this is empty slot
                {
                    continue;
                }
                if (player.UserKey == UserKey)
                {
                    unsit(player, index, listener);
                    return(player);
                    // break;
                }
            }
            return(null);
        }
Exemple #8
0
        private void sendSitDownInfoToAllUserInRoom(Slot player, int index, bool isSit, TexasSitDownListener listener)
        {
            if (listener == null)
            {
                return;
            }
            SitDownInfo sitDownInfo = new SitDownInfo();

            sitDownInfo.AvatarKey = player.AvatarKey;
            sitDownInfo.Index     = index;
            sitDownInfo.IsSitDown = isSit;
            sitDownInfo.UserKey   = player.UserKey;
            sitDownInfo.UserName  = player.UserName;
            TexasSitDown texasSitDown = new TexasSitDown();

            texasSitDown.sisDownInfo = sitDownInfo;
            listener.PushSitDownNotification(texasSitDown);
        }