Ejemplo n.º 1
0
 public void RemoveEventListner(EventDispatch action, string eventType)
 {
     Dispatcher dispatcher = null;
     if (dispatchObjects.TryGetValue (action, out dispatcher))
     {
         dispatchObjects.Remove (action);
         _RemoveEventListener (Dispatcher.InvokeSelector, dispatcher, eventType);
     }
 }
Ejemplo n.º 2
0
        protected ePlayDirection m_curPlayDirection;        // 如果是 PingPang 播放的时候当前播放方向

        public SpriteAni()
        {
            m_leftTime = 0;
            m_curFrame = 0;
            m_bLoop = false;
            m_bNeedReloadRes = false;
            m_playState = SpritePlayState.eNone;
            m_playEndEventDispatch = new AddOnceAndCallOnceEventDispatch();
            m_bKeepLastFrame = false;
            m_loopType = eSpriteLoopType.eSequence;
            m_curPlayDirection = ePlayDirection.ePositive;
        }
Ejemplo n.º 3
0
        override public void dispose()
        {
            if (m_selfGo != null)
            {
                UtilApi.Destroy(m_selfGo);
                m_selfGo = null;
            }

            if(m_modelRes != null)
            {
                Ctx.m_instance.m_modelMgr.unload(m_modelRes.GetPath(), null);
                m_modelRes = null;
            }

            m_modelInsDisp.clearEventHandle();
            m_modelInsDisp = null;

            base.dispose();
        }
Ejemplo n.º 4
0
 void ThemeForm_HandleCreated(object sender, EventArgs e)
 {
     ApplyIcons();
     EventDispatch.RegisterHandler(this);
 }
Ejemplo n.º 5
0
 public SkeletonAnim()
 {
     this.bNeedPlaceHolderGo = true;
     m_bNeedReloadSkel = false;
     m_skelLoadDisp = new EventDispatch();
 }
Ejemplo n.º 6
0
 public void OnExistRoom()
 {
     OnClose();
     EventDispatch.Dispatch((int)NetEventId.OnDismissRoom, new EventData(EnDismissFeedBack.ApplyFor));
 }
Ejemplo n.º 7
0
        public override void SetShowInfo(TableData table, Texture[] defineArray)
        {
            ShareScoreUiGob.SetActive(false);
            ShareLianZhuangUiGob.SetActive(false);
            ShareFlowerUiGob.SetActive(false);
            Btns.SetActive(false);
            foreach (var ewgob in ErweiGobs)
            {
                ewgob.SetActive(false);
            }
            BackToHallBtn.SetActive(table.RoomInfo.RoomType == EnRoomType.YuLe);

            gameObject.SetActive(true);

            MahjongManager.Instance.Reset();

            if (RoomID != null)
            {
                RoomID.text = table.RoomInfo.RoomID + "";
            }
            if (RoundImg != null)
            {
                RoundImg.sprite = table.RoomInfo.GameLoopType == EnGameLoopType.round ? JuImg : QuanImg;
            }
            if (Round != null)
            {
                Round.text = table.RoomInfo.CurrRound + "/" + table.RoomInfo.MaxRound;
            }

            foreach (OnRoudResultItem item in Items)
            {
                item.SetVisible = false;
            }

            var seatList = new List <int>();

            for (int i = 0; i < UtilData.CurrGamePalyerCnt; i++)
            {
                seatList.Add(i);
            }
            //根据胡牌玩家排序
            seatList.Sort((a, b) =>
            {
                bool isAHu = table.Result.HuSeat.Contains(a);
                bool isBHu = table.Result.HuSeat.Contains(b);
                if (isAHu && !isBHu)
                {
                    return(-1);
                }

                if (!isAHu && isBHu)
                {
                    return(1);
                }

                if (isAHu && isBHu)
                {
                    int aScore = table.Result.HuGold[a];
                    int bScore = table.Result.HuGold[b];

                    if (aScore < bScore)
                    {
                        return(-1);
                    }
                    if (aScore > bScore)
                    {
                        return(1);
                    }
                }

                return(0);
            });

            UtilFunc.OutPutList(seatList, "游戏结束 玩家胡牌排序后");
            if (BaoArea != null)
            {
                int bao = table.Result.bao;

                if (bao > 0)
                {
                    GameObject baoItem = D2MahjongMng.Instance.GetMj(bao, EnD2MjType.Up, bao);
                    baoItem.transform.parent        = BaoArea;
                    baoItem.transform.localPosition = Vector3.zero;
                    baoItem.transform.localScale    = Vector3.one;
                }
            }
            //是否赢
            bool isMeWin = table.Result.HuSeat.Contains(table.PlayerSeat);
            //是否流局
            bool isLiuJu = table.Result.HuType == MjRequestData.MJReqTypeLastCd;

            int huCnt = 1;

            for (int i = 0; i < seatList.Count; i++)
            {
                int seat = seatList[i];
                Items[i].SetVisible = true;
                Items[i].Name       = table.UserDatas[seat].name;


                var hunameInfo = table.Result.HuName[seat];


                Items[i].StrHuInfo    = hunameInfo;
                Items[i].IntHuScore   = table.Result.HuGold[seat];
                Items[i].IntGangScore = table.Result.GangGlod[seat];
                Items[i].IntScore     = table.Result.Gold[seat];
                Items[i].IsHu         = false;
                Items[i].IsBanker     = seat == table.BankerSeat;
                // 码分
                Items[i].SetNiaoScore = table.Result.NiaoGold[seat];
                //吃碰杠加入
                Items[i].SetCpgCardJp(table.UserCpg[seat], table.Laizi);
                Items[i].SetHardCard(table.UserHardCard[seat].ToArray(), table.Laizi);

                bool ishu = false;
                //设置胡牌信息
                if (huCnt++ <= table.Result.HuSeat.Count)
                {
                    ishu          = true;
                    Items[i].IsHu = true;
                    Items[i].SetHardCard(new[] { table.Result.HuCard }, table.Laizi);
                }

                Items[i].SortCardGroup();

                Items[i].HuTypeValue = table.Result.UserHuType[seat];

                Items[i].SetHeadImg(table.UserDatas[seat].HeadImage, defineArray[table.UserDatas[seat].Sex % 2]);

                if (OnerdExtraMsgItems[i] != null)
                {
                    var bgimg = OnerdExtraMsgItems[i].GetComponent <Image>();
                    if (bgimg != null)
                    {
                        if (!isLiuJu)
                        {
                            bgimg.sprite = isMeWin ? WinbgImg : LosebgImg;
                        }
                        else
                        {
                            bgimg.sprite = HebgImg;
                        }
                    }

                    var buzhangList = new int[] {};
                    var buzhangLen  = table.Result.BuZhangList.Count;
                    if (buzhangLen >= seat && buzhangLen > 0)
                    {
                        buzhangList = table.Result.BuZhangList[seat];
                    }
                    OnerdExtraMsgItems[i].SetExtraInfo(table.Result.Huaname[seat],
                                                       table.Result.Taicnt[seat], table.Result.Huacnt[seat], CheckLaiziGroup(table.UserHardCard[seat].ToArray(), table.Result.HuCard,
                                                                                                                             ishu, table.Laizi), buzhangList, table.Laizi,
                                                       table.Result.IsBaoPai[seat], table.Result.LianZhuangInfo[seat], table.Fanpai);
                }


                #region  添加分享信息
                var shareGoldScore = table.Result.ShareShowGold[seat];
                if (seat == table.PlayerSeat)
                {
                    var jptabledata = table as JpTableData;

                    if (jptabledata != null)
                    {
                        //胡了,且分数足够分享
                        var ishuAndShareScore = ishu && shareGoldScore >= jptabledata.ShareHuScoreValue;
                        //没胡,但花数足够分享
                        var nohuAndShareHua = !ishu && table.Result.Huacnt[seat] >= jptabledata.ShareHuHuaNumValue;
                        if (ishuAndShareScore || nohuAndShareHua)
                        {
                            ShareScoreUiGob.SetActive(true);

                            //分数信息
                            if (ishuAndShareScore)
                            {
                                SelfPlayerHuScoreText.text  = YxUtiles.GetShowNumber(shareGoldScore).ToString(CultureInfo.InvariantCulture) + "分";
                                SelfPlayerHuScoreText1.text = "总积分:" + YxUtiles.GetShowNumber(shareGoldScore).ToString(CultureInfo.InvariantCulture) + "分";
                                HurawImgBg.SetActive(true);
                                HuaShareRawImgBg.SetActive(false);
                            }
                            else if (nohuAndShareHua)
                            {
                                HuaNumtext.text  = "花:" + table.Result.Huacnt[seat];
                                HuaNumtext1.text = "花:" + table.Result.Huacnt[seat];
                                HurawImgBg.SetActive(false);
                                HuaShareRawImgBg.SetActive(true);
                            }


                            //头像信息
                            SetShareHeadImg(table.UserDatas[seat].HeadImage, ShareHeadImgScore,
                                            defineArray[table.UserDatas[seat].Sex % 2]);

                            //按钮
                            Btns.SetActive(true);



                            var cdinfoOnrditem = CardsInfoZone.GetComponent <OnRoudResultItem>();
                            cdinfoOnrditem.Cleare();
                            cdinfoOnrditem.SetCpgCardJp(table.UserCpg[seat], table.Laizi);
                            cdinfoOnrditem.SetHardCard(table.UserHardCard[seat].ToArray(), table.Laizi);
                            if (ishu)
                            {
                                cdinfoOnrditem.SetHardCard(new[] { table.Result.HuCard }, table.Laizi);
                            }
                            cdinfoOnrditem.SortCardGroup();

                            cdinfoOnrditem.StrHuInfo = hunameInfo;

                            var onrdextramessage = CardsInfoZone.GetComponent <OneRdExtraMessShow>();
                            onrdextramessage.SetExtraInfo(table.Result.Huaname[seat],
                                                          table.Result.Taicnt[seat], table.Result.Huacnt[seat], CheckLaiziGroup(table.UserHardCard[seat].ToArray(), table.Result.HuCard,
                                                                                                                                ishu, table.Laizi), table.Result.BuZhangList[seat], table.Laizi,
                                                          table.Result.IsBaoPai[seat], table.Result.LianZhuangInfo[seat], table.Fanpai);
                            onrdextramessage.SetEstraCds();
                        }
                        else if (table.Result.LianZhuangNumInfo[seat] >= jptabledata.LianzhuangNum)
                        {
                            //连庄数信息
                            SelfPlayerlianzhuangZhuangText.text = table.Result.LianZhuangNumInfo[seat].ToString(CultureInfo.InvariantCulture);
                            //连庄信息
                            SelfPlayerlianzhuanInfoText.text = table.Result.LianZhuangInfo[seat];

                            ShareLianZhuangUiGob.SetActive(true);

                            SetShareHeadImg(table.UserDatas[seat].HeadImage, ShareHeadImgLianzhuang,
                                            defineArray[table.UserDatas[seat].Sex % 2]);

                            Btns.SetActive(true);
                        }
                    }
                }
                #endregion
            }

            if (UtilData.RoomType == EnRoomType.YuLe)
            {
                _startCall = () =>
                {
                    Hide();
                    EventDispatch.Dispatch((int)NetEventId.OnGameRestart, new EventData());
                };
            }

            if (isMeWin)
            {
                if (Gril != null)
                {
                    Gril.sprite = GrilWin;
                }
                if (Result != null)
                {
                    Result.sprite = WinSpr;
                }
            }
            else
            {
                if (Gril != null)
                {
                    Gril.sprite = GrilLost;
                }
                if (Result != null)
                {
                    Result.sprite = LostSpr;
                }
            }

            if (isLiuJu) //流局
            {
                if (Result != null)
                {
                    Result.sprite = HeSpr;
                }
            }

            if (_laterUnfoldCor != null)
            {
                StopCoroutine(_laterUnfoldCor);
            }
            _laterUnfoldCor = StartCoroutine(LaterUnfoldingInfo());
        }
Ejemplo n.º 8
0
 public override void OnEnter()
 {
     EventDispatch.Broadcast(Events.DlgTextShow);
 }
Ejemplo n.º 9
0
 public void AddEventListener(EventDispatch action, string eventType, bool retain)
 {
     var dispatcher = new Dispatcher (action);
     _AddEventListener (Dispatcher.InvokeSelector, dispatcher, eventType, retain);
     dispatchObjects.Add(action, dispatcher);
 }
Ejemplo n.º 10
0
 public void OnClickStartButton()
 {
     EventDispatch.Broadcast(Events.DlgLevelShow);
 }
Ejemplo n.º 11
0
        public void OnExecuteShortcut(OPMShortcutEventArgs args)
        {
            if (args.Handled)
            {
                return;
            }

            bool refreshButtonState = false;

            switch (args.cmd)
            {
            case OPMShortcut.CmdClear:
                Clear();
                args.Handled = true;
                break;

            case OPMShortcut.CmdDelete:
                Delete();
                args.Handled = true;
                break;

            case OPMShortcut.CmdLoadPlaylist:
                LoadPlaylist();
                args.Handled = true;
                break;

            case OPMShortcut.CmdSavePlaylist:
                SavePlaylist();
                args.Handled = true;
                break;

            case OPMShortcut.CmdMoveDown:
                MoveDown();
                args.Handled = true;
                break;

            case OPMShortcut.CmdMoveUp:
                MoveUp();
                args.Handled = true;
                break;

            case OPMShortcut.CmdJumpToItem:
                HandleJumpToItem();
                args.Handled = true;
                break;

            case OPMShortcut.CmdToggleShuffle:
                ProTONEConfig.ShufflePlaylist ^= true;

                playlist.SetupRandomSequence(playlist.PlayIndex);
                args.Handled       = true;
                refreshButtonState = true;
                break;

            case OPMShortcut.CmdLoopPlay:
                ProTONEConfig.LoopPlay ^= true;

                args.Handled       = true;
                refreshButtonState = true;
                break;

            case OPMShortcut.CmdPlaylistEnd:
                SystemScheduler.PlaylistEventEnabled ^= true;
                refreshButtonState = true;
                args.Handled       = true;
                break;
            }

            if (refreshButtonState)
            {
                EventDispatch.DispatchEvent(LocalEventNames.UpdateStateButtons);
            }
        }
Ejemplo n.º 12
0
 public override void Realse()
 {
     EventDispatch.RemoveListener("DlgLogin", this.Show);
 }
Ejemplo n.º 13
0
 protected override void OnRemoveListener()
 {
     EventDispatch.RemoveListener(Events.DlgStartMoneyUpdate, this.UpdateMoney);
 }
Ejemplo n.º 14
0
 public override void Init()
 {
     EventDispatch.AddListener("DlgLogin", this.Show);
 }
Ejemplo n.º 15
0
 protected void OnSortTalkClick(int key)
 {
     EventDispatch.Dispatch((int)NetEventId.OnUserTalk, new EventData(EnChatType.sorttalk, key));
     Hide();
 }
Ejemplo n.º 16
0
 protected void OnExpressClick(int key)
 {
     EventDispatch.Dispatch((int)NetEventId.OnUserTalk, new EventData(EnChatType.exp, key));
     Hide();
 }
Ejemplo n.º 17
0
        protected EventDispatch m_modelInsDisp;      // 模型加载并且实例化后事件分发

        public AuxDynModel()
        {
            m_modelInsDisp = new AddOnceEventDispatch();
            m_bNeedReloadModel = false;
        }
Ejemplo n.º 18
0
 public RegWindow()
 {
     InitializeComponent();
     EventDispatch.addEventListener(this);
 }
Ejemplo n.º 19
0
        protected EventDispatch m_hurtExecEndDisp;  // Hurt Item 执行结束事件分发

        public HurtItemBase(EHurtType hurtType)
        {
            m_hurtType        = hurtType;
            m_execState       = EHurtExecState.eNone;
            m_hurtExecEndDisp = new AddOnceAndCallOnceEventDispatch();
        }
Ejemplo n.º 20
0
        Dictionary <int, deskNode> dic = new Dictionary <int, deskNode>();//用来保存座位号,和对应的桌子


        private RoomControll()
        {
            RoomInfo = new roomInfo();
            EventDispatch.addEventListener(this, "do");
            Debug.Log("newlControll");
        }
Ejemplo n.º 21
0
 public override void OnLeave()
 {
     EventDispatch.Broadcast(Events.DlgTextHide);
 }
Ejemplo n.º 22
0
 public Dispatcher(EventDispatch action)
 {
     this.Action = action;
 }
Ejemplo n.º 23
0
 public void AddEventListener(EventDispatch action, string eventType)
 {
     AddEventListener (action, eventType, false);
 }
Ejemplo n.º 24
0
 private void AddListeners()
 {
     EventDispatch.AddEventListener <EntityParent, int>(Event.LogicSoundEvent.OnHitYelling, OnHitYelling);
 }
 void MediaScreens_HandleDestroyed(object sender, EventArgs e)
 {
     EventDispatch.UnregisterHandler(this);
 }
Ejemplo n.º 26
0
 public void RemoveListeners()
 {
     EventDispatch.RemoveEventListener <EntityParent, int>(Event.LogicSoundEvent.OnHitYelling, OnHitYelling);
 }
 private static void InnerDisplayNonFatalError(string message, string title)
 {
     EventDispatch.SendEventNotification(EventNames.ShowMessageBox, message, title, MessageBoxIcon.Error);
 }
 void MediaScreens_HandleCreated(object sender, EventArgs e)
 {
     EventDispatch.RegisterHandler(this);
     ThemeManager.SetDoubleBuffer(this);
 }
Ejemplo n.º 29
0
 public RoomView()
 {
     EventDispatch.addEventListener(this, "do");
     U3DSocket.shareSocket().StartRead();
 }
Ejemplo n.º 30
0
 private static void AddListeners()
 {
     EventDispatch.AddEventListener <RoleAttachedInfo>(Event.FrameWorkEvent.EntityAttached, OnEntityAttached);
 }
Ejemplo n.º 31
0
 protected int startConnectTime = 0;//开始连接时间
 public virtual void init()
 {
     eventDispatcher = new EventDispatch();
     _byteBuffer     = new byte[MAX_READ];
     status          = NetStatus.Disconnected;
 }
Ejemplo n.º 32
0
 public override void Init()
 {
     EventDispatch.AddListener(Events.DlgPlayGuideShow, this.Show);
     EventDispatch.AddListener(Events.DlgPlayGuideHide, this.Hide);
 }
Ejemplo n.º 33
0
 void ThemeForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     EventDispatch.UnregisterHandler(this);
 }
Ejemplo n.º 34
0
 public override void Realse()
 {
     EventDispatch.RemoveListener(Events.DlgPlayGuideShow, this.Show);
     EventDispatch.RemoveListener(Events.DlgPlayGuideHide, this.Hide);
 }
Ejemplo n.º 35
0
 public void OnShowDismissPnlClick()
 {
     EventDispatch.Dispatch((int)UIEventId.OnShowDismissPnl);
 }
Ejemplo n.º 36
0
 protected override void OnAddListener()
 {
     EventDispatch.AddListener(Events.DlgGuideExecuteNextTask, this.ExecuteNextGuide);
     EventDispatch.AddListener <EGuideTaskType, int>(Events.DlgGuideChildTaskFinished, this.OnFinishChildTask);
 }
Ejemplo n.º 37
0
 protected override void OnRemoveListener()
 {
     EventDispatch.RemoveListener <EGuideTaskType, int>(Events.DlgGuideChildTaskFinished, this.OnFinishChildTask);
 }
Ejemplo n.º 38
0
        protected EventDispatch m_modelInsDisp;      // 模型加载并且实例化后事件分发

        public AuxDynModel()
        {
            m_modelInsDisp     = new AddOnceEventDispatch();
            m_bNeedReloadModel = false;
        }