コード例 #1
0
		public MahjongDealerIndicator( MahjongGame game, Point2D position, MahjongPieceDirection direction, MahjongWind wind )
		{
			m_Game = game;
			m_Position = position;
			m_Direction = direction;
			m_Wind = wind;
		}
コード例 #2
0
		public MahjongWallBreakIndicator( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Position = reader.ReadPoint2D();
		}
コード例 #3
0
		public MahjongDices( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_First = reader.ReadInt();
			m_Second = reader.ReadInt();
		}
コード例 #4
0
ファイル: MahjongTile.cs プロジェクト: greeduomacro/last-wish
		public MahjongTile( MahjongGame game, int number, MahjongTileType value, Point2D position, int stackLevel, MahjongPieceDirection direction, bool flipped )
		{
			m_Game = game;
			m_Number = number;
			m_Value = value;
			m_Position = position;
			m_StackLevel = stackLevel;
			m_Direction = direction;
			m_Flipped = flipped;
		}
コード例 #5
0
		public MahjongDealerIndicator( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Position = reader.ReadPoint2D();
			m_Direction = (MahjongPieceDirection) reader.ReadInt();
			m_Wind = (MahjongWind) reader.ReadInt();
		}
コード例 #6
0
 public MahjongTile(MahjongGame game, int number, MahjongTileType value, Point2D position, int stackLevel,
                    MahjongPieceDirection direction, bool flipped)
 {
     Game       = game;
     Number     = number;
     Value      = value;
     m_Position = position;
     StackLevel = stackLevel;
     Direction  = direction;
     Flipped    = flipped;
 }
コード例 #7
0
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine = mjMachine;
            mjGame         = mjMachine.mjGame;
            mjAssets       = mjMachine.mjAssets;

            defaultPrefabDict = mjAssets.defaultPrefabDict;
            effectPrefabDict  = mjAssets.effectPrefabDict;
            mjpaiPrefabDict   = mjAssets.mjpaiPrefabDict;
            uiPrefabDict      = mjAssets.uiPrefabDict;
        }
コード例 #8
0
        /// <summary>
        /// 设置骰子机
        /// </summary>
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine = mjMachine;
            mjGame         = mjMachine.mjGame;
            mjAssets       = mjMachine.mjAssets;
            mjAssetsMgr    = mjMachine.mjAssetsMgr;
            mjTable        = mjMachine.mjtableTransform;

            numSpritesDict = mjMachine.mjAssets.settingDataAssetsMgr.GetSpritesIntKeyDict((int)SpritesType.DICE_MACHINE_TIMER_NUM);
            blueNums       = numSpritesDict[(int)SpriteIdx.BLUE_NUMS];

            prefabDiceMachine = mjAssets.defaultPrefabDict[(int)PrefabIdx.DICE_MACHINE][0];
        }
コード例 #9
0
ファイル: MahjongTile.cs プロジェクト: greeduomacro/last-wish
		public MahjongTile( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Number = reader.ReadInt();
			m_Value = (MahjongTileType) reader.ReadInt();
			m_Position = reader.ReadPoint2D();
			m_StackLevel = reader.ReadInt();
			m_Direction = (MahjongPieceDirection) reader.ReadInt();
			m_Flipped = reader.ReadBool();
		}
コード例 #10
0
        public MahjongTile(MahjongGame game, GenericReader reader)
        {
            m_Game = game;

            int version = reader.ReadInt();

            m_Number     = reader.ReadInt();
            m_Value      = (MahjongTileType)reader.ReadInt();
            m_Position   = reader.ReadPoint2D();
            m_StackLevel = reader.ReadInt();
            m_Direction  = (MahjongPieceDirection)reader.ReadInt();
            m_Flipped    = reader.ReadBool();
        }
コード例 #11
0
ファイル: MahjongTile.cs プロジェクト: tateima/PathOfUO
        public MahjongTile(MahjongGame game, IGenericReader reader)
        {
            Game = game;

            var version = reader.ReadInt();

            Number     = reader.ReadInt();
            Value      = (MahjongTileType)reader.ReadInt();
            m_Position = reader.ReadPoint2D();
            StackLevel = reader.ReadInt();
            Direction  = (MahjongPieceDirection)reader.ReadInt();
            Flipped    = reader.ReadBool();
        }
コード例 #12
0
ファイル: UIChiPaiTips.cs プロジェクト: cymheart/3DMahjong
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine    = mjMachine;
            mjGame            = mjMachine.mjGame;
            mjAssets          = mjMachine.mjAssets;
            mjAssetsMgr       = mjMachine.mjAssetsMgr;
            uiCanvasTransform = mjMachine.uiCanvasTransform;

            prefabUiPaiTips = mjAssets.uiPrefabDict[(int)PrefabIdx.UI_CHIPAI_TIPS][0];
            paiTipsOrgSize  = prefabUiPaiTips.GetComponent <RectTransform>().sizeDelta;

            prefabUiPaiDetailTips = mjAssets.uiPrefabDict[(int)PrefabIdx.UI_CHIPAI_DETAIL_TIPS][0];
            detailTipsSize        = prefabUiPaiDetailTips.GetComponent <RectTransform>().sizeDelta;
        }
コード例 #13
0
ファイル: UIScore.cs プロジェクト: cymheart/3DMahjong
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine    = mjMachine;
            mjGame            = mjMachine.mjGame;
            mjAssets          = mjMachine.mjAssets;
            mjAssetsMgr       = mjMachine.mjAssetsMgr;
            uiCanvasTransform = mjMachine.uiCanvasTransform;

            prefabUIScoreDec = mjAssets.uiPrefabDict[(int)PrefabIdx.UI_SCORE][0];
            prefabUIScoreInc = mjAssets.uiPrefabDict[(int)PrefabIdx.UI_SCORE][1];

            prefabSpeedLine = mjAssets.effectPrefabDict[(int)PrefabIdx.UI_SPEED_LINE_EFFECT][0];

            prefabStarShan = mjAssets.effectPrefabDict[(int)PrefabIdx.UI_STAR_SHAN_EFFECT][0];
        }
コード例 #14
0
    public MahjongPlayers(MahjongGame game, int maxPlayers, int baseScore)
    {
        _game       = game;
        _spectators = new List <Mobile>();

        _players    = new Mobile[maxPlayers];
        _inGame     = new bool[maxPlayers];
        _publicHand = new bool[maxPlayers];
        _scores     = new int[maxPlayers];

        for (var i = 0; i < _scores.Length; i++)
        {
            _scores[i] = baseScore;
        }
    }
コード例 #15
0
        public void TestMahjongGeneralInfo(bool showScores, bool spectatorVision)
        {
            var game = new MahjongGame {
                ShowScores = showScores, SpectatorVision = spectatorVision
            };

            var expected = new MahjongGeneralInfo(game).Compile();

            var ns = PacketTestUtilities.CreateTestNetState();

            ns.SendMahjongGeneralInfo(game);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
コード例 #16
0
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine    = mjMachine;
            mjGame            = mjMachine.mjGame;
            mjAssets          = mjMachine.mjAssets;
            mjAssetsMgr       = mjMachine.mjAssetsMgr;
            uiCanvasTransform = mjMachine.uiCanvasTransform;

            prefabUiSelectHuaSeHandPaiTips = mjAssets.uiPrefabDict[(int)PrefabIdx.UI_SELECT_SWAP_HANDPAI][0];

            selectSpriteDict = mjMachine.mjAssets.settingDataAssetsMgr.GetSpritesIntKeyDict((int)SpritesType.SELECT);
            que_text         = selectSpriteDict[(int)SpriteIdx.SELECT_QUE_TEXT];
            ding_text        = selectSpriteDict[(int)SpriteIdx.SELECT_DING_TEXT];
            numSprites       = selectSpriteDict[(int)SpriteIdx.SELECT_NUMS];
            greyNumSprites   = selectSpriteDict[(int)SpriteIdx.SELECT_NUMS_GREY];
            kuohaoSprites    = selectSpriteDict[(int)SpriteIdx.SELECT_KUOHAO];
        }
コード例 #17
0
ファイル: UIPCGHTBtnMgr.cs プロジェクト: cymheart/3DMahjong
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine    = mjMachine;
            mjGame            = mjMachine.mjGame;
            mjAssets          = mjMachine.mjAssets;
            mjAssetsMgr       = mjMachine.mjAssetsMgr;
            uiCanvasTransform = mjMachine.uiCanvasTransform;
            pcghtBtnLayout    = uiCanvasTransform.Find("PengChiGangHuTingBtnLayout");

            layoutOrgPos = pcghtBtnLayout.localPosition;

            uiHuBtn.Setting(mjMachine);
            uiPengBtn.Setting(mjMachine, PengChiGangTingHuType.PENG);
            uiChiBtn.Setting(mjMachine, PengChiGangTingHuType.CHI);
            uiGangBtn.Setting(mjMachine, PengChiGangTingHuType.GANG);
            uiTingBtn.Setting(mjMachine, PengChiGangTingHuType.TING);
            uiGuoBtn.Setting(mjMachine, PengChiGangTingHuType.GUO);
            uiCancelBtn.Setting(mjMachine, PengChiGangTingHuType.CANCEL);
        }
コード例 #18
0
ファイル: GameEntryPoint.cs プロジェクト: DeveloperFor/Hall
    void Start()
    {
        //UIDebugViewController.Instance.OpenViewRoot ();

        int level = SceneManager.GetActiveScene().buildIndex;

        switch (level)
        {
        case 0:
            break;

        case 1:
        {
            UILoginController.Instance.Open();
        }
        break;

        case 2:
        {
            UIMainMenuController.Instance.Open();
        }
        break;

        case 3:
        {
            var         go   = new GameObject("MahjongGame");
            MahjongGame game = go.AddComponent <MahjongGame>();
            GameClient.Instance.CurrentGameMode = game;
            UIGameSetingController.Instance.Open();
            if (GameClient.Instance.GameStateDef != null)
            {
                game.OnRestoreGameState(GameClient.Instance.GameStateDef);
                GameClient.Instance.GameStateDef = null;
                UIGameSetingController.Instance.OnRefreshHeadAll();
                GameClient.Instance.MG._shuffle_initpocket_state = 1;
            }
        }
        break;
        }
    }
コード例 #19
0
        public void TestMahjongTilesInfo(bool spectatorVision)
        {
            var m = new Mobile(0x1);

            m.DefaultMobileInit();

            var game = new MahjongGame {
                SpectatorVision = spectatorVision
            };

            game.Players.Join(m);

            var expected = new MahjongTilesInfo(game, m).Compile();

            var ns = PacketTestUtilities.CreateTestNetState();

            ns.SendMahjongTilesInfo(game, m);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
コード例 #20
0
ファイル: UIHuBtn.cs プロジェクト: cymheart/3DMahjong
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine    = mjMachine;
            mjGame            = mjMachine.mjGame;
            mjAssets          = mjMachine.mjAssets;
            mjAssetsMgr       = mjMachine.mjAssetsMgr;
            uiCanvasTransform = mjMachine.uiCanvasTransform;

            uiBtn         = mjAssetsMgr.pengChiGangTingHuBtns[(int)PengChiGangTingHuType.HU].transform;
            orgUIBtnScale = uiBtn.localScale;


            uiBtnPS               = uiBtn.GetComponent <ParticleSystem>();
            huTextPS              = uiBtn.Find("HuText").GetComponent <ParticleSystem>();
            huTextHuXiPS          = uiBtn.Find("HuTextHuXi").GetComponent <ParticleSystem>();
            meiHuaImgPS           = uiBtn.Find("MeiHuaImg").GetComponent <ParticleSystem>();
            outsideExtGuangQuanPS = uiBtn.Find("OutsideExtGuangQuan").GetComponent <ParticleSystem>();
            petalsPS              = uiBtn.Find("Petals").GetComponent <ParticleSystem>();
            petalsPS2             = uiBtn.Find("Petals2").GetComponent <ParticleSystem>();
            petalsPS3             = uiBtn.Find("Petals3").GetComponent <ParticleSystem>();

            Image img = uiBtn.GetComponent <Image>();

            mat = img.material;


            meiHuaImgScale = meiHuaImgPS.transform.DOLocalRotate(new Vector3(0, 0, 10f), 1.5f);
            meiHuaImgScale.SetAutoKill(false);
            meiHuaImgScale.SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
            meiHuaImgScale.Pause();

            mjAssetsMgr.AppendToDestoryPool(meiHuaImgScale);

            EventTriggerListener.Get(uiBtn.gameObject).onDown  = OnButtonDown;
            EventTriggerListener.Get(uiBtn.gameObject).onClick = OnButtonClick;

            State5();
        }
コード例 #21
0
 public MahjongDices(MahjongGame game)
 {
     m_Game   = game;
     m_First  = Utility.Random(1, 6);
     m_Second = Utility.Random(1, 6);
 }
コード例 #22
0
 public MahjongDices(MahjongGame game)
 {
     Game   = game;
     First  = Utility.Random(1, 6);
     Second = Utility.Random(1, 6);
 }
コード例 #23
0
 public MahjongPlayers(MahjongGame game)
 {
     _game       = game;
     _spectators = new List <Mobile>();
 }
コード例 #24
0
 public int Renchan_Calculation(MahjongGame game)
 {
     return(game.Renchan);
 }
コード例 #25
0
 public RoundBuilder(bool tonpuusen = false)
 {
     _gameState = new MahjongGame(tonpuusen);
 }
コード例 #26
0
 public MahjongWallBreakIndicator(MahjongGame game) => _game = game;
コード例 #27
0
 public GameState FinishRound_ThrowsExceptionsForInvalidGameState(MahjongGame game)
 {
     game.FinishRound(new RoundResult());
     return(game.State);
 }
コード例 #28
0
 public MahjongDices(MahjongGame game)
 {
     _game   = game;
     _first  = Utility.Random(1, 6);
     _second = Utility.Random(1, 6);
 }
コード例 #29
0
		public MahjongDices( MahjongGame game )
		{
			m_Game = game;
			m_First = Utility.Random( 1, 6 );
			m_Second = Utility.Random( 1, 6 );
		}
コード例 #30
0
 public GameState GameState_ReturnsCorrectly(MahjongGame game)
 {
     return(game.State);
 }
コード例 #31
0
 public int Oya_Calculation(MahjongGame game)
 {
     return(game.Oya);
 }
コード例 #32
0
 public MahjongDealerIndicator(MahjongGame game)
 {
     _game = game;
 }
コード例 #33
0
 public MahjongTile(MahjongGame game) => _game = game;
コード例 #34
0
 public MahjongWallBreakIndicator(MahjongGame game, Point2D position)
 {
     m_Game     = game;
     m_Position = position;
 }
コード例 #35
0
 public int NextRound_AddsRoundCorrectly(MahjongGame game)
 {
     game.NextRound();
     return(game.Rounds.Count);
 }
コード例 #36
0
 public int NextRound_UpdatesOyaCorrectly(MahjongGame game)
 {
     game.NextRound();
     return(game.Rounds.Last().Oya);
 }
コード例 #37
0
 public void NextRound_ThrowsExceptionsForInvalidGameState(MahjongGame game)
 {
     game.NextRound();
 }
コード例 #38
0
		public MahjongWallBreakIndicator( MahjongGame game, Point2D position )
		{
			m_Game = game;
			m_Position = position;
		}